diff options
author | David Walter Seikel | 2012-01-16 00:17:58 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-16 00:17:58 +1000 |
commit | b7e7424918853627bff4e037dbb053a91dd93b26 (patch) | |
tree | 7cbdc7f9d39b2792104b831c27453e9a440e051d /LuaSL/src | |
parent | Actually make use of the lexers line and column numbers. (diff) | |
download | SledjHamr-b7e7424918853627bff4e037dbb053a91dd93b26.zip SledjHamr-b7e7424918853627bff4e037dbb053a91dd93b26.tar.gz SledjHamr-b7e7424918853627bff4e037dbb053a91dd93b26.tar.bz2 SledjHamr-b7e7424918853627bff4e037dbb053a91dd93b26.tar.xz |
Report line and column in syntax errors, and stack overflows.
Diffstat (limited to 'LuaSL/src')
-rw-r--r-- | LuaSL/src/LuaSL_lemon_yaccer.y | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/LuaSL/src/LuaSL_lemon_yaccer.y b/LuaSL/src/LuaSL_lemon_yaccer.y index 045c997..5cffb73 100644 --- a/LuaSL/src/LuaSL_lemon_yaccer.y +++ b/LuaSL/src/LuaSL_lemon_yaccer.y | |||
@@ -84,12 +84,11 @@ script ::= statement(A). { A->left = param->ast; param->ast = A; } | |||
84 | 84 | ||
85 | %parse_accept {printf("Parsing complete.\n");} | 85 | %parse_accept {printf("Parsing complete.\n");} |
86 | 86 | ||
87 | // TODO - Alledgedly this gets passed some sort of apparently useful information. shrug | 87 | %parse_failure {fprintf(stderr,"Giving up. Parser is hopelessly lost!\n");} |
88 | %syntax_error {fprintf(stderr,"Syntax error!\n");} | ||
89 | 88 | ||
90 | %parse_failure {fprintf(stderr,"Giving up. Parser is hopelessly lost...\n");} | 89 | %stack_overflow {fprintf(stderr,"Giving up. Parser stack overflow @ line %04d column %04d\n", yypMinor->yy0->line, yypMinor->yy0->column);} // Gotta love consistancy, if it ever happens. |
91 | 90 | ||
92 | %stack_overflow {fprintf(stderr,"Giving up. Parser stack overflow!\n");} | 91 | %syntax_error {fprintf(stderr,"Syntax error @ line %04d column %04d\n", yyminor.yy0->line, yyminor.yy0->column);} |
93 | 92 | ||
94 | 93 | ||
95 | /* Undocumented shit that might be useful later. Pffft | 94 | /* Undocumented shit that might be useful later. Pffft |