diff options
| author | Marc Vertes <mvertes@free.fr> | 2025-11-27 14:50:07 +0100 |
|---|---|---|
| committer | Marc Vertes <mvertes@free.fr> | 2025-11-27 14:50:07 +0100 |
| commit | 22b020225ae77ca1cf9f9984817df9b7fd1aaa12 (patch) | |
| tree | fdbb8d0ccae08b248c1e1d787ba66d624ab6a34c /compiler/compiler.go | |
| parent | 8e32cc1a5617f84d0bd7bf1fd898251675d5a653 (diff) | |
fix: improve parser, compiler and interpreter APIs
Pass a language spec as an argument when create a new parser,
compiler or interpreter.
Also move the REPL code in interpreter package.
Diffstat (limited to 'compiler/compiler.go')
| -rw-r--r-- | compiler/compiler.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/compiler.go b/compiler/compiler.go index d63dd14..f7c8a12 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -26,9 +26,9 @@ type Compiler struct { } // NewCompiler returns a new compiler state for a given scanner. -func NewCompiler(scanner *scanner.Scanner) *Compiler { +func NewCompiler(spec *lang.Spec) *Compiler { return &Compiler{ - Parser: parser.NewParser(scanner, true), + Parser: parser.NewParser(spec, true), Entry: -1, strings: map[string]int{}, } |
