in reply to Re^4: how to match entire buffer with Parse::RecDescent
in thread how to match entire buffer with Parse::RecDescent
expression : INTEGER OP expression { main::expression(@item) } | VARIABLE OP expression { main::expression(@item) } | INTEGER | VARIABLE { $main::VARIABLE{$item{VARIABLE}} ||= 0 }
Remaining "returns" deleted, then it works. + I made uninitialized variable default to 0, seems to make sense.
Enter --> a=2 print a 2 Enter --> b=3 print b blah 3 ERROR (line 1): Invalid instruction: Was expecting assign instr +uction, or print instruction Error returned by parsing
|
|---|