From e8575e8c5b204d28dcc96a84d5431a8395af143b Mon Sep 17 00:00:00 2001
From: odino
- + diff --git a/docs/README.md b/docs/README.md index f2f91360..3539f04e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -5,7 +5,7 @@
-
+
diff --git a/js/js.go b/js/js.go
deleted file mode 100644
index af2ade88..00000000
--- a/js/js.go
+++ /dev/null
@@ -1,59 +0,0 @@
-package main
-
-import (
- "bytes"
- "fmt"
- "syscall/js"
-
- "github.com/abs-lang/abs/evaluator"
- "github.com/abs-lang/abs/lexer"
- "github.com/abs-lang/abs/object"
- "github.com/abs-lang/abs/parser"
-)
-
-// Version of the ABS interpreter
-var Version = "dev"
-
-// This function takes ABS code
-// and evaluates it, using a buffer
-// to store it's output.
-// Once the code is evaluated, both
-// the output and the return value of
-// the script are returned to js in the
-// form of {out, result}.
-func runCode(this js.Value, i []js.Value) interface{} {
- m := make(map[string]interface{})
- var buf bytes.Buffer
- // the first argument to our function
- code := i[0].String()
- env := object.NewEnvironment(&buf, "", Version)
- lex := lexer.New(code)
- p := parser.New(lex)
-
- program := p.ParseProgram()
-
- if len(p.Errors()) != 0 {
- printParserErrors(p.Errors(), buf)
- m["out"] = buf.String()
- return js.ValueOf(m)
- }
-
- result := evaluator.BeginEval(program, env, lex)
- m["out"] = buf.String()
- m["result"] = result.Inspect()
-
- return js.ValueOf(m)
-}
-
-func printParserErrors(errors []string, buf bytes.Buffer) {
- fmt.Fprintf(&buf, "%s", " parser errors:\n")
- for _, msg := range errors {
- fmt.Fprintf(&buf, "%s", "\t"+msg+"\n")
- }
-}
-
-func main() {
- c := make(chan struct{}, 0)
- js.Global().Set("abs_run_code", js.FuncOf(runCode))
- <-c
-}
diff --git a/main b/main
new file mode 100755
index 0000000000000000000000000000000000000000..f6ba1ee54aac12fbee4313931c0867d28a1d7b30
GIT binary patch
literal 8141829
zcmeFad3;pW`9D5^3`Pjv5kaCN3_5D!f=NY9gy;l 3$1Z{iz~Ke`QaUU_kf%UkN;ufw^ij7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