summaryrefslogtreecommitdiff
path: root/g.peg
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2023-08-04 00:06:05 +0100
committerubq323 <ubq323@ubq323.website>2023-08-04 00:06:49 +0100
commitd8b50976ce7fd4a44ba9172d69e8ae4ca6cab596 (patch)
treea87f179fd4608da63acbfcbf584dab11a2167896 /g.peg
parent8b96f9a4f27ed859bdd975608419c86841664dc9 (diff)
add string object values. you can't do anything with them yet
Diffstat (limited to 'g.peg')
-rw-r--r--g.peg8
1 files changed, 5 insertions, 3 deletions
diff --git a/g.peg b/g.peg
index 552d76f..c026e62 100644
--- a/g.peg
+++ b/g.peg
@@ -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]*