From 74b51fb8cc2945af10da841a2ff901f4d3046977 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Mon, 2 Aug 2021 01:42:50 +0900 Subject: Print expected terminals on a parse error --- spec/grammar.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'spec/grammar.go') 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 { -- cgit v1.2.3