Remove std.stdio import and printing of unexpected tokens

This commit is contained in:
josh committed 2023-07-17 21:57:31 -04:00
1 parent d39fa61af0
commit c4bcb465da
2 files changed
+19 -13

No files matched your search

+1 -13
View File
@@ -3,12 +3,10 @@
*
* This file is generated by Propane.
*/
<% if @grammar.modulename %>
module <%= @grammar.modulename %>;
module <%= @grammar.modulename %>;
<% end %>
import std.stdio;
/**************************************************************************
* User code blocks
@@ -913,16 +911,6 @@ public size_t <%= @grammar.prefix %>parse(<%= @grammar.prefix %>context_t * cont
continue;
}
/* Error, unexpected token. */
write("Unexpected token ");
if (token != INVALID_TOKEN_ID)
{
writeln(<%= @grammar.prefix %>token_names[token]);
}
else
{
writeln("{other}");
}
/* A token was successfully lexed, so the input text position was
* advanced. However, this is an unexpected token, so we want to reset
* the context text position to point to the token rather than the text