aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-09-03 17:09:03 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-09-03 17:09:03 +0900
commitad35bf24d80c36b3847538cf846d35de7751f7f2 (patch)
treed503defc8467d08c89a47f568bb9a3bebf8ab8b2
parentAdd tests for LAC (diff)
downloadurubu-ad35bf24d80c36b3847538cf846d35de7751f7f2.tar.gz
urubu-ad35bf24d80c36b3847538cf846d35de7751f7f2.tar.xz
Use the LALR by default when using grammar.Compile instead of the CLI
-rw-r--r--grammar/grammar.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/grammar/grammar.go b/grammar/grammar.go
index 7e86ea8..1080e53 100644
--- a/grammar/grammar.go
+++ b/grammar/grammar.go
@@ -977,7 +977,9 @@ func SpecifyClass(class Class) CompileOption {
}
func Compile(gram *Grammar, opts ...CompileOption) (*spec.CompiledGrammar, error) {
- config := &compileConfig{}
+ config := &compileConfig{
+ class: ClassLALR,
+ }
for _, opt := range opts {
opt(config)
}