From c1a39a23cb7b948b142bee9ae6ad61b40c81b142 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Sun, 21 Jul 2013 17:58:34 +1000 Subject: [PATCH] parsergen - adjust for recent scanner fix. scanner was recently fixed to correctly skip over C code with a string immediately after a '(', so we can remove the extra spaces we inserted before. For this to work, we need to stop ignoring TK_String Signed-off-by: NeilBrown --- csrc/parsergen.mdc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/csrc/parsergen.mdc b/csrc/parsergen.mdc index ddf03ab..5d5ea1e 100644 --- a/csrc/parsergen.mdc +++ b/csrc/parsergen.mdc @@ -528,7 +528,7 @@ Now we are ready to read in the grammar. .ignored = (1 << TK_line_comment) | (1 << TK_block_comment) | (0 << TK_number) - | (0 << TK_string) + | (1 << TK_string) | (1 << TK_multi_string) | (1 << TK_indent) | (1 << TK_undent), @@ -2523,23 +2523,23 @@ something like this. Session -> Session Line | Line - Line -> Expression NEWLINE ${ gmp_printf( "Answer = %Qd\n", $1.val); + Line -> Expression NEWLINE ${ gmp_printf("Answer = %Qd\n", $1.val); { mpf_t fl; mpf_init2(fl, 20); mpf_set_q(fl, $1.val); - gmp_printf( " or as a decimal: %Fg\n", fl); + gmp_printf(" or as a decimal: %Fg\n", fl); mpf_clear(fl); } }$ | Expression = Expression NEWLINE ${ if (mpq_equal($1.val, $3.val)) - gmp_printf( "Both equal %Qd\n", $1.val); + gmp_printf("Both equal %Qd\n", $1.val); else { - gmp_printf( "NOT EQUAL: %Qd\n != : %Qd\n", + gmp_printf("NOT EQUAL: %Qd\n != : %Qd\n", $1.val, $3.val); exit(1); } }$ - | NEWLINE ${ printf( "Blank line\n"); }$ - | ERROR NEWLINE ${ printf( "Skipped a bad line\n"); }$ + | NEWLINE ${ printf("Blank line\n"); }$ + | ERROR NEWLINE ${ printf("Skipped a bad line\n"); }$ $number Expression -> Expression + Term ${ mpq_init($0.val); mpq_add($0.val, $1.val, $3.val); }$ -- 2.43.0