diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2022-11-05 14:21:13 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2022-11-05 14:21:13 +0900 |
commit | b24f61a465d21af404ed647a977160042017e601 (patch) | |
tree | 0b695a6775ed6a0a7bb41404b598055855417673 /driver/template.go | |
parent | Update README (diff) | |
download | urubu-b24f61a465d21af404ed647a977160042017e601.tar.gz urubu-b24f61a465d21af404ed647a977160042017e601.tar.xz |
Remove alias system
Remove unimportant features to tidy up the specification.
Diffstat (limited to 'driver/template.go')
-rw-r--r-- | driver/template.go | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/driver/template.go b/driver/template.go index 5ff3aa5..87c74f6 100644 --- a/driver/template.go +++ b/driver/template.go @@ -147,7 +147,6 @@ type grammarImpl struct { nonTerminals []string lhsSymbols []int terminals []string - terminalAliases []string astActions [][]int } @@ -161,7 +160,6 @@ func NewGrammar() *grammarImpl { nonTerminals: {{ genNonTerminals }}, lhsSymbols: {{ genLHSSymbols }}, terminals: {{ genTerminals }}, - terminalAliases: {{ genTerminalAliases }}, astActions: {{ genASTActions }}, } } @@ -218,10 +216,6 @@ func (g *grammarImpl) Terminal(terminal int) string { return g.terminals[terminal] } -func (g *grammarImpl) TerminalAlias(terminal int) string { - return g.terminalAliases[terminal] -} - func (g *grammarImpl) ASTAction(prod int) []int { return g.astActions[prod] } @@ -361,15 +355,6 @@ func genGrammarTemplateFuncs(cgram *spec.CompiledGrammar) template.FuncMap { fmt.Fprintf(&b, "}") return b.String() }, - "genTerminalAliases": func() string { - var b strings.Builder - fmt.Fprintf(&b, "[]string{\n") - for _, v := range cgram.LexicalSpecification.Maleeni.KindAliases { - fmt.Fprintf(&b, "%v,\n", strconv.Quote(v)) - } - fmt.Fprintf(&b, "}") - return b.String() - }, "genASTActions": func() string { var b strings.Builder fmt.Fprintf(&b, "[][]int{\n") |