lang: parser: Define variable identifier in the parser
Instead of in the lexer. I think this simplifies things and gives the parser more information which should hopefully make it easier to parse without shift/reduce conflicts.
This commit is contained in:
@@ -295,14 +295,6 @@
|
||||
panic(fmt.Sprintf("error lexing FLOAT, got: %v", err))
|
||||
}
|
||||
}
|
||||
/\$[a-z]([a-z0-9_]*[a-z0-9]+)?/
|
||||
{
|
||||
// an alternate pattern: /\$[a-z](|[a-z0-9_]*[a-z0-9])/
|
||||
yylex.pos(lval) // our pos
|
||||
s := yylex.Text()
|
||||
lval.str = s[1:len(s)] // remove the leading $
|
||||
return VAR_IDENTIFIER
|
||||
}
|
||||
/[a-z]([a-z0-9_]*[a-z0-9]+)?/
|
||||
{
|
||||
yylex.pos(lval) // our pos
|
||||
|
||||
Reference in New Issue
Block a user