require_list(p);
if (matches(p, T_PROVIDES))
provide_list(p);
- definition_list(p);
+// definition_list(p);
parse_exit();
}
static void provide_list(Parser* p) {
parse_enter();
accept(p, T_PROVIDES);
- expect(p, '(');
+ expect(p, '{');
while (!matches(p, ')')) {
- Tok* tok = expect_val(p, T_ID);
- pkg_add_provide(&(p->pkg), tok->text);
+ if (matches(p, T_LET) || matches(p, T_VAR)) {
+ //declaration(p);
+ } else if (matches(p, T_TYPE)) {
+ //type_definition(p);
+ } else if (matches(p, T_FUN)) {
+ //func_declaration(p);
+ } else {
+ error(p, "only definitions are allowed at the top level");
+ }
}
- expect(p, ')');
+ expect(p, '}');
parse_exit();
}