}
switch (diagnostic) {
+ case DIAGNOSTIC_EXPECTED_END:
+ for (; len < vec_size(vec_last(read)->values); len++)
+ space += strlen(vec_last(read)->values[len]);
+
+ /* +/- 1 because of the ^ */
+ len = space - column - 1;
+ space = column + 1;
+ break;
+
case DIAGNOSTIC_EXPRESSION_CASE:
case DIAGNOSTIC_SEMICOLON:
for (; len < vec_size(vec_last(read)->values); len++)
* enable the marker (to show where it's missing).
*/
case DIAGNOSTIC_SEMICOLON:
- linebeg++;
- marker = true;
- break;
-
case DIAGNOSTIC_EXPRESSION_CASE:
+ case DIAGNOSTIC_EXPECTED_END:
linebeg++;
marker = true;
break;
-
- case DIAGNOSTIC_EXPECTED:
- marker = true;
- break;
-
+
case DIAGNOSTIC_UNEXPECTED_IDENT:
+ case DIAGNOSTIC_EXPECTED:
marker = true;
break;
DIAGNOSTIC_SEMICOLON,
DIAGNOSTIC_EXPRESSION_CASE,
DIAGNOSTIC_UNEXPECTED_IDENT,
- DIAGNOSTIC_EXPECTED
+ DIAGNOSTIC_EXPECTED,
+ DIAGNOSTIC_EXPECTED_END
};
void diagnostic_destroy();
}
}
if (!concatenated) {
+ parser->diagnostic = DIAGNOSTIC_EXPECTED_END;
parseerror(parser, "expected operator or end of statement");
goto onerr;
}
*/
if (vec_size(match) > vec_size(task_tasks[i].tmpl->comparematch)) {
for (d = 0; d < vec_size(match) - vec_size(task_tasks[i].tmpl->comparematch); d++) {
- con_out(" Expected: Nothing | Got: \"%s\"\n",
+ con_out(" Expected: Nothing | Got: \"%s\"\n",
match[d + vec_size(task_tasks[i].tmpl->comparematch)]
);
}
--- /dev/null
+const vector foo = '1 2 3'
--- /dev/null
+I: expend.qc
+D: expected end of statement
+T: -diagnostic
+C: -std=gmqcc
+M: expected operator or end of statement
+M: 2: const vector foo = '1 2 3'
+M: ~~~~~~~^
+M: unexpected eof
+