basic error reporting
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
identifier [A-z_][A-z0-9_]*
|
||||
wsnl [ \t\r\v\f\n]
|
||||
|
||||
%option yylineno
|
||||
%%
|
||||
|
||||
program{wsnl}+{identifier}{wsnl}+begin{wsnl}+ { return PROGRAM_HEAD; }
|
||||
|
@ -4,7 +4,10 @@
|
||||
#include "eaxhla.yy.h"
|
||||
#include "assembler.h"
|
||||
|
||||
void yyerror() { ; }
|
||||
void yyerror() {
|
||||
printf("\033[31mError: syntax error at line %d.\033[0m\n", yylineno);
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
%union{
|
||||
|
Reference in New Issue
Block a user