mirror of
https://github.com/armory3d/armorpaint.git
synced 2026-10-02 02:54:34 +08:00
libs: minic fixes
This commit is contained in:
@@ -2248,10 +2248,19 @@ static void minic_scan_top_level(minic_comp_t *c, bool globals) {
|
|||||||
}
|
}
|
||||||
minic_ctype_t type;
|
minic_ctype_t type;
|
||||||
if (!minic_parse_type(c, &c->i, true, &type)) {
|
if (!minic_parse_type(c, &c->i, true, &type)) {
|
||||||
|
if (t != TOK_SEMICOLON) {
|
||||||
|
minic_error(c, "unexpected token outside of a function");
|
||||||
|
return;
|
||||||
|
}
|
||||||
minic_next(c);
|
minic_next(c);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (minic_cur(c) != TOK_IDENT) {
|
if (minic_cur(c) != TOK_IDENT) {
|
||||||
|
// Qualifiers such as const are parsed as an opaque type, the declared type follows
|
||||||
|
if (!minic_tok_is_type(minic_cur(c)) && minic_cur(c) != TOK_STRUCT) {
|
||||||
|
minic_error(c, "statement outside of a function");
|
||||||
|
return;
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (minic_peek(c, 1) != TOK_LPAREN) {
|
if (minic_peek(c, 1) != TOK_LPAREN) {
|
||||||
|
|||||||
Reference in New Issue
Block a user