From d9eb793ad606fd47d17a17af24b78b46f2180f84 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 11 Jul 2023 02:06:59 +0100 Subject: allow more characters in symbols --- grammar.peg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'grammar.peg') diff --git a/grammar.peg b/grammar.peg index 9b8e882..12847e5 100644 --- a/grammar.peg +++ b/grammar.peg @@ -22,10 +22,10 @@ list <- { $$ = astnode_new_list(); } )* ')' _ -number <- < [0-9]+ > _ { $$ = astnode_new_num(atoi($1)); } -symbol <- < [a-z]+ > _ { $$ = astnode_new_symbol(strdup($1)); } - +number <- < [0-9]+ > _ (! ident_char) { $$ = astnode_new_num(atoi($1)); } +symbol <- < ident_char+ > _ { $$ = astnode_new_symbol(strdup($1)); } +ident_char <- [-_a-zA-Z'+*0-9] _ <- [ \t]* %% -- cgit v1.2.3