summaryrefslogtreecommitdiff
path: root/vm0/vm_test.go
diff options
context:
space:
mode:
authorMarc Vertes <marc.vertes@tendermint.com>2023-10-12 10:51:58 +0200
committerGitHub <noreply@github.com>2023-10-12 10:51:58 +0200
commit37b9da32d3b911091deb254f6cba2a137c471287 (patch)
treeb4451de0fa0473a937a77d39fd1f8a4f87c8f60d /vm0/vm_test.go
parenta21b9b12ad865a19ff687645082f9093c4101039 (diff)
move to a direct byte code compiler (#8)
* chore: refactor to keep only the new parser and bytecode vm * scanner: remove Token.value field * scanner: remove scanner.kind field * chore: move language specification in lang package This avoid a cyclic dependency in scanner_test which can now use the golang/GoSpec language specification for Go. * clean code * scanner: export scanner fields Also parser now generate function calls, including externals. * chore: fix lint issues * parser: handle strings * wip * parser: implement support for 'if, else, else if' statements Resolving labels in the compiler still in progress. * parser: support if statements, improve compiler * improve handling of functions * improve support of local variables * scanner: trim leading and trailing spaces * fixes to make fibonacci work * parser: improve README, fix function parameters parsing
Diffstat (limited to 'vm0/vm_test.go')
-rw-r--r--vm0/vm_test.go26
1 files changed, 0 insertions, 26 deletions
diff --git a/vm0/vm_test.go b/vm0/vm_test.go
deleted file mode 100644
index a4a24e6..0000000
--- a/vm0/vm_test.go
+++ /dev/null
@@ -1,26 +0,0 @@
-package vm0
-
-import (
- "os"
- "testing"
-
- "github.com/gnolang/parscan/lang/golang"
-)
-
-func TestEval(t *testing.T) {
- i := New(golang.GoParser)
- t.Logf("%#v\n", i.Parser)
- //i.Eval("println(2*5)")
- //n, _ := i.Parse("println(2*5)")
- //n, _ := i.Parse(`a := 2 + 5`)
- src := `a := 2`
- nodes, err := i.Parse(src, nil)
- if err != nil {
- t.Errorf("error %v", err)
- }
- i.Adot(nodes, os.Getenv("DOT"))
- for _, n := range nodes {
- err := i.Run(n, "")
- t.Log(err)
- }
-}