diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-09-07 01:35:58 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-09-07 02:17:41 +0900 |
commit | a57fda765cd32b44cd069da1c9a442b701b36dc2 (patch) | |
tree | e8f72fbcac83fc18525263051e50d2b17f11ef24 /driver/parser.go | |
parent | Call the 'MissError' when input doesn't meet an error production (diff) | |
download | urubu-a57fda765cd32b44cd069da1c9a442b701b36dc2.tar.gz urubu-a57fda765cd32b44cd069da1c9a442b701b36dc2.tar.xz |
Pass a token that caused a syntax error to the semantic action APIs
Diffstat (limited to 'driver/parser.go')
-rw-r--r-- | driver/parser.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/driver/parser.go b/driver/parser.go index 3099d73..c9b6229 100644 --- a/driver/parser.go +++ b/driver/parser.go @@ -137,7 +137,7 @@ ACTION_LOOP: } if tok.EOF { if p.semAct != nil { - p.semAct.MissError() + p.semAct.MissError(tok) } return nil @@ -157,7 +157,7 @@ ACTION_LOOP: count, ok := p.trapError() if !ok { if p.semAct != nil { - p.semAct.MissError() + p.semAct.MissError(tok) } return nil @@ -174,7 +174,7 @@ ACTION_LOOP: p.shift(act * -1) if p.semAct != nil { - p.semAct.TrapAndShiftError(count) + p.semAct.TrapAndShiftError(tok, count) } } } |