add multi line support for more stuff
This commit is contained in:
@@ -18,11 +18,11 @@ ParsedValue *parse_assign(char *file, DArray *tokens, ParsedValue *assign_to,
|
||||
ParsedCall *call = assign_to->data;
|
||||
for (size_t i = 0; i < call->args->size; i++) {
|
||||
if (((ParsedValue *)darray_get(call->args, i))->type != AST_IDENTIFIER) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"%s:%zu:%zu error: parameter names need to start with a letter or _, "
|
||||
"only use letters, digits, or _, and can't be keywords.\n",
|
||||
file, token->line, token->column);
|
||||
fprintf(stderr,
|
||||
"%s:%zu:%zu error: parameter names need to start with a letter "
|
||||
"or _, "
|
||||
"only use letters, digits, or _, and can't be keywords.\n",
|
||||
file, token->line, token->column);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,11 @@ ParsedValue *parse_assign(char *file, DArray *tokens, ParsedValue *assign_to,
|
||||
error_if_finished(file, tokens, index);
|
||||
token = darray_get(tokens, *index);
|
||||
assign->from = parse_token(file, tokens, index, true);
|
||||
if (!assign->from) {
|
||||
fprintf(stderr, "%s:%zu:%zu error: syntax error\n", file, token->line,
|
||||
token->column);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
ParsedValue *parsedValue = checked_malloc(sizeof(ParsedValue));
|
||||
parsedValue->type = AST_ASSIGN;
|
||||
parsedValue->data = assign;
|
||||
|
||||
Reference in New Issue
Block a user