mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Bugfix when strings are unterminated
This commit is contained in:
@@ -36,7 +36,6 @@ static void advance(Parser* parser) {
|
||||
|
||||
if (parser->current.type == TOKEN_ERROR) {
|
||||
error(parser, parser->current, "Lexer error");
|
||||
printf(parser->lexer->source);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,10 +145,19 @@ static Opcode compound(Parser* parser, Node** nodeHandle, bool canBeAssigned) {
|
||||
//store the left
|
||||
parsePrecedence(parser, &left, PREC_PRIMARY);
|
||||
|
||||
if (!left) { //error
|
||||
return OP_EOF;
|
||||
}
|
||||
|
||||
//detect a dictionary
|
||||
if (match(parser, TOKEN_COLON)) {
|
||||
parsePrecedence(parser, &right, PREC_PRIMARY);
|
||||
|
||||
if (!right) { //error
|
||||
freeNode(left);
|
||||
return OP_EOF;
|
||||
}
|
||||
|
||||
//check we ARE defining a dictionary
|
||||
if (array) {
|
||||
error(parser, parser->previous, "Incorrect detection between array and dictionary");
|
||||
|
||||
Reference in New Issue
Block a user