aboutsummaryrefslogtreecommitdiff
path: root/spec/grammar.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-08-02 01:42:50 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-08-02 01:42:50 +0900
commit74b51fb8cc2945af10da841a2ff901f4d3046977 (patch)
treec4f3d5e2f3fb4969cd7393107210e22649240f06 /spec/grammar.go
parentUse maleeni v0.3.0 (diff)
downloadurubu-74b51fb8cc2945af10da841a2ff901f4d3046977.tar.gz
urubu-74b51fb8cc2945af10da841a2ff901f4d3046977.tar.xz
Print expected terminals on a parse error
Diffstat (limited to 'spec/grammar.go')
-rw-r--r--spec/grammar.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/spec/grammar.go b/spec/grammar.go
index eeeb372..002fac9 100644
--- a/spec/grammar.go
+++ b/spec/grammar.go
@@ -16,6 +16,7 @@ type LexicalSpecification struct {
type Maleeni struct {
Spec *mlspec.CompiledLexSpec `json:"spec"`
KindToTerminal []int `json:"kind_to_terminal"`
+ TerminalToKind []int `json:"terminal_to_kind"`
Skip []int `json:"skip"`
}
@@ -32,6 +33,7 @@ type ParsingTable struct {
NonTerminals []string `json:"non_terminals"`
NonTerminalCount int `json:"non_terminal_count"`
EOFSymbol int `json:"eof_symbol"`
+ ExpectedTerminals [][]int `json:"expected_terminals"`
}
type ASTAction struct {