diff options
author | ubq323 <ubq323@ubq323.website> | 2023-08-04 00:06:05 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2023-08-04 00:06:49 +0100 |
commit | d8b50976ce7fd4a44ba9172d69e8ae4ca6cab596 (patch) | |
tree | a87f179fd4608da63acbfcbf584dab11a2167896 /g.peg | |
parent | 8b96f9a4f27ed859bdd975608419c86841664dc9 (diff) |
add string object values. you can't do anything with them yet
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]* |