aboutsummaryrefslogtreecommitdiff
path: root/compiler/compiler.go
diff options
context:
space:
mode:
authorRyo Nihei <nihei.dev@gmail.com>2021-05-08 16:34:13 +0900
committerRyo Nihei <nihei.dev@gmail.com>2021-05-08 16:34:13 +0900
commitaa73b03f626189789224c3cc9a0d18e288a5a7b4 (patch)
treebda7c0e2238418d86b9d2a8bb000908513c1639d /compiler/compiler.go
parentChange type of acceping_states to slice (diff)
downloadtre-aa73b03f626189789224c3cc9a0d18e288a5a7b4.tar.gz
tre-aa73b03f626189789224c3cc9a0d18e288a5a7b4.tar.xz
Add CLI options
Diffstat (limited to 'compiler/compiler.go')
-rw-r--r--compiler/compiler.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/compiler.go b/compiler/compiler.go
index ffe0511..d1720de 100644
--- a/compiler/compiler.go
+++ b/compiler/compiler.go
@@ -10,9 +10,9 @@ import (
"github.com/nihei9/maleeni/spec"
)
-type compilerOption func(c *compilerConfig) error
+type CompilerOption func(c *compilerConfig) error
-func EnableLogging(w io.Writer) compilerOption {
+func EnableLogging(w io.Writer) CompilerOption {
return func(c *compilerConfig) error {
logger, err := log.NewLogger(w)
if err != nil {
@@ -27,7 +27,7 @@ type compilerConfig struct {
logger log.Logger
}
-func Compile(lexspec *spec.LexSpec, opts ...compilerOption) (*spec.CompiledLexSpec, error) {
+func Compile(lexspec *spec.LexSpec, opts ...CompilerOption) (*spec.CompiledLexSpec, error) {
err := lexspec.Validate()
if err != nil {
return nil, fmt.Errorf("invalid lexical specification:\n%w", err)