switch (diagnostic) {
case DIAGNOSTIC_SEMICOLON:
- break;
-
- case DIAGNOSTIC_SEMICOLON_SAME:
for (; len < vec_size(vec_last(read)->values); len++)
space += strlen(vec_last(read)->values[len]);
space -= beg - end;
break;
- case DIAGNOSTIC_ASSIGNMENT:
+ default:
break;
}
linebeg++;
marker = true;
break;
-
- case DIAGNOSTIC_SEMICOLON_SAME:
- linecnt = 1;
- linebeg = line-2;
- marker = true;
- break;
-
- /*
- * Cases that don't need line calculation should break the
- * statement and carry on to the feeder.
- */
- case DIAGNOSTIC_ASSIGNMENT:
- break;
/* Catches the DIAGNOSTIC_NULL and out of range case */
default:
/*===================================================================*/
enum {
DIAGNOSTIC_NULL,
- DIAGNOSTIC_SEMICOLON, /* Where semicolon requires from next line */
- DIAGNOSTIC_SEMICOLON_SAME, /* Where semicolon required from same line */
- DIAGNOSTIC_ASSIGNMENT
+ DIAGNOSTIC_SEMICOLON
};
void diagnostic_destroy();
field->next->vtype == TYPE_FUNCTION &&
exprs[1]->vtype == TYPE_FUNCTION)
{
- parser->diagnostic = DIAGNOSTIC_ASSIGNMENT;
(void)!compile_warning(ctx, WARN_ASSIGN_FUNCTION_TYPES,
"invalid types in assignment: cannot assign %s to %s", ty2, ty1);
}
else {
- parser->diagnostic = DIAGNOSTIC_ASSIGNMENT;
compile_error(ctx, "invalid types in assignment: cannot assign %s to %s", ty2, ty1);
}
}
if (!e)
return NULL;
if (parser->tok != ';') {
+ parser->diagnostic = DIAGNOSTIC_SEMICOLON;
parseerror(parser, "semicolon expected after expression");
ast_unref(e);
return NULL;
if (parser->tok != '=') {
const char *obtain = parser_tokval(parser);
if (!strcmp(obtain, "}")) {
- parser->diagnostic = DIAGNOSTIC_SEMICOLON_SAME;
- parseerror(parser, "expected semicolon, got `%s`", obtain);
+ parser->diagnostic = DIAGNOSTIC_SEMICOLON;
+ parseerror(parser, "expected semicolon");
} else
parseerror(parser, "missing initializer");
break;