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 /spec/test/tree_parser.go | |
parent | Update README (diff) | |
download | cotia-b24f61a465d21af404ed647a977160042017e601.tar.gz cotia-b24f61a465d21af404ed647a977160042017e601.tar.xz |
Remove alias system
Remove unimportant features to tidy up the specification.
Diffstat (limited to 'spec/test/tree_parser.go')
-rw-r--r-- | spec/test/tree_parser.go | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/spec/test/tree_parser.go b/spec/test/tree_parser.go index bcbe382..0e834ae 100644 --- a/spec/test/tree_parser.go +++ b/spec/test/tree_parser.go @@ -46,9 +46,6 @@ type Grammar interface { // Terminal retuns a string representaion of a terminal symbol. Terminal(terminal int) string - // TerminalAlias returns an alias for a terminal. - TerminalAlias(terminal int) string - // ASTAction returns an AST action entries. ASTAction(prod int) []int } @@ -372,11 +369,7 @@ func (p *Parser) searchLookahead(state int) []string { continue } - if alias := p.gram.TerminalAlias(term); alias != "" { - kinds = append(kinds, alias) - } else { - kinds = append(kinds, p.gram.Terminal(term)) - } + kinds = append(kinds, p.gram.Terminal(term)) } return kinds @@ -429,7 +422,6 @@ type grammarImpl struct { nonTerminals []string lhsSymbols []int terminals []string - terminalAliases []string astActions [][]int } @@ -549,27 +541,6 @@ func NewGrammar() *grammarImpl { "escape_char", "interpreted_string_close", }, - terminalAliases: []string{ - "", - "", - "", - "", - "(", - ")", - "", - "", - "", - "", - "\"", - "", - "\\u", - "{", - "}", - "", - "", - "\\", - "\"", - }, astActions: [][]int{ nil, nil, @@ -676,10 +647,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] } |