diff options
-rw-r--r-- | parse.c | 8 | ||||
-rw-r--r-- | test.toc | 9 |
2 files changed, 8 insertions, 9 deletions
@@ -1286,16 +1286,24 @@ static bool parse_expr(Parser *p, Expression *e, Token *end) { if (paren_level > 0) { t->token = start; + while (!token_is_kw(t->token, KW_LPAREN)) + ++t->token; + tokr_err(t, "Too many opening parentheses (."); return false; } if (brace_level > 0) { t->token = start; + while (!token_is_kw(t->token, KW_LBRACE)) + ++t->token; + tokr_err(t, "Too many opening braces {."); return false; } if (square_level > 0) { t->token = start; + while (!token_is_kw(t->token, KW_LSQUARE)) + ++t->token; tokr_err(t, "Too many opening square brackets [."); return false; } @@ -13,16 +13,7 @@ putf ::= fn(x: float) { main ::= fn() { - s ::= struct { x,y,z:int; f:f32; }; - puti(#alignof(s)); - puti(#sizeof(s)); - -}; -/* -something's wrong (should be too few opening parentheses!) -main ::= fn() { puti(#alignof(struct { x,y,z:int; f:f64; }); puti(#sizeof(struct { x,y,z:int; f:f64; }); }; -*/
\ No newline at end of file |