From ea095957d446033df1f10817f5f68c2af79a8729 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Thu, 19 Jan 2017 19:25:34 -0600 Subject: nqasm: don't echo unknown tokens --- lexer.l | 2 ++ parser.y | 1 + 2 files changed, 3 insertions(+) diff --git a/lexer.l b/lexer.l index 9b1548d..4a593fe 100644 --- a/lexer.l +++ b/lexer.l @@ -95,4 +95,6 @@ HEX [0-9a-f] <> { return 0; } <> { BEGIN(INITIAL); return T_EOL; } +. { return T_UNKNOWN; } + %% diff --git a/parser.y b/parser.y index ed33aa4..8998c37 100644 --- a/parser.y +++ b/parser.y @@ -37,6 +37,7 @@ void yyerror(const char *msg) %token END 0 "end of file" +%token T_UNKNOWN %token T_SPACE %token T_EOL -- cgit v1.2.3