}
switch (diagnostic) {
+ case DIAGNOSTIC_EXPRESSION_CASE:
case DIAGNOSTIC_SEMICOLON:
for (; len < vec_size(vec_last(read)->values); len++)
space += strlen(vec_last(read)->values[len]);
linebeg++;
marker = true;
break;
+
+ case DIAGNOSTIC_EXPRESSION_CASE:
+ linebeg++;
+ marker = true;
+ break;
/* Catches the DIAGNOSTIC_NULL and out of range case */
default:
/*===================================================================*/
enum {
DIAGNOSTIC_NULL,
- DIAGNOSTIC_SEMICOLON
+ DIAGNOSTIC_SEMICOLON,
+ DIAGNOSTIC_EXPRESSION_CASE
};
void diagnostic_destroy();
if (!strcmp(parser_tokval(parser), "case")) {
if (!parser_next(parser)) {
ast_delete(switchnode);
+ parser->diagnostic = DIAGNOSTIC_EXPRESSION_CASE;
parseerror(parser, "expected expression for case");
return false;
}
swcase.value = parse_expression_leave(parser, false, false, false);
if (!swcase.value) {
ast_delete(switchnode);
+ parser->diagnostic = DIAGNOSTIC_EXPRESSION_CASE;
parseerror(parser, "expected expression for case");
return false;
}