From a57fda765cd32b44cd069da1c9a442b701b36dc2 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Tue, 7 Sep 2021 01:35:58 +0900 Subject: Pass a token that caused a syntax error to the semantic action APIs --- driver/parser.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'driver/parser.go') 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) } } } -- cgit v1.2.3