diff options
Diffstat (limited to 'g.peg')
-rw-r--r-- | g.peg | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -3,13 +3,15 @@ #include <stdlib.h> #include <string.h> -/* + +#ifdef DO_PARSE_DEBUG static const char *dbg_str[] = { "Evaluating rule", "Matched rule", "Abandoning rule" }; #define PCC_DEBUG(auxil, event, rule, level, pos, buffer, length) \ fprintf(stderr, "%*s%s %s @%zu [%.*s]\n", (int)((level) * 2), "", dbg_str[event], rule, pos, (int)(length), buffer) +#endif + -*/ } @@ -35,7 +37,7 @@ list <- { $$ = astnode_new_list(); } number <- < [0-9]+ > (! ident_char) _ { $$ = astnode_new_num(atoi($1)); } ident <- < ident_char+ > _ { $$ = astnode_new_ident(strdup($1)); } -string <- '"' < [^"]+ > '"' { $$ = astnode_new_string(strdup($1)); } +string <- '"' < [^"]+ > '"' _ { $$ = astnode_new_string(strdup($1)); } ident_char <- [-_a-zA-Z'+*0-9] _ <- [ \t\n]* |