Added compiler and scanner packages
All checks were successful
/ test (push) Successful in 15s

This commit is contained in:
Eduard Urbach 2025-06-19 13:05:55 +02:00
parent f1457af6be
commit e5baba175b
Signed by: akyoto
GPG key ID: 49226B848C78F6C8
12 changed files with 221 additions and 4 deletions

8
src/compiler/Compile.go Normal file
View file

@ -0,0 +1,8 @@
package compiler
import "git.urbach.dev/cli/q/src/scanner"
// Compile waits for the scan to finish and compiles all functions.
func Compile(scan scanner.Result) (Result, error) {
return Result{}, nil
}

View file

@ -0,0 +1,16 @@
package compiler_test
import (
"testing"
"git.urbach.dev/cli/q/src/build"
"git.urbach.dev/cli/q/src/compiler"
"git.urbach.dev/cli/q/src/scanner"
"git.urbach.dev/go/assert"
)
func TestCompile(t *testing.T) {
b := build.New("../../examples/hello")
_, err := compiler.Compile(scanner.Scan(b))
assert.Nil(t, err)
}

4
src/compiler/Result.go Normal file
View file

@ -0,0 +1,4 @@
package compiler
// Result contains everything we need to write an executable file to disk.
type Result struct{}