Make the error code blocks into fail() calls.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 22 Feb 2010 01:58:37 -0500
changeset 848 8ff6c5d37d33
parent 847 cb7997b93a1a
child 849 91f88707edbe
Make the error code blocks into fail() calls. I think I want this to be more robust, still, though.
mojoshader_parser_hlsl.lemon
--- a/mojoshader_parser_hlsl.lemon	Mon Feb 22 01:57:53 2010 -0500
+++ b/mojoshader_parser_hlsl.lemon	Mon Feb 22 01:58:37 2010 -0500
@@ -36,20 +36,17 @@
 
 %syntax_error {
     // !!! FIXME: make this a proper fail() function.
-    ctx->isfail = 1;
-    fprintf(stderr,"Syntax error\n");
+    fail(ctx, "Syntax error");
 }
 
 %parse_failure {
     // !!! FIXME: make this a proper fail() function.
-    ctx->isfail = 1;
-    fprintf(stderr,"Giving up.  Parser is hopelessly lost...\n");
+    fail(ctx, "Giving up. Parser is hopelessly lost...");
 }
 
 %stack_overflow {
     // !!! FIXME: make this a proper fail() function.
-    ctx->isfail = 1;
-    fprintf(stderr,"Giving up.  Parser stack overflow\n");
+    fail(ctx, "Giving up. Parser stack overflow");
 }
 
 // operator precedence (matches C spec)...