aboutsummaryrefslogtreecommitdiff
path: root/driver/parser.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-09-07 01:35:58 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-09-07 02:17:41 +0900
commita57fda765cd32b44cd069da1c9a442b701b36dc2 (patch)
treee8f72fbcac83fc18525263051e50d2b17f11ef24 /driver/parser.go
parentCall the 'MissError' when input doesn't meet an error production (diff)
downloadcotia-a57fda765cd32b44cd069da1c9a442b701b36dc2.tar.gz
cotia-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.go6
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)
}
}
}