Commit graph

27 commits

Author SHA1 Message Date
Ozan Hacıbekiroğlu
4ed75764ce
enable relative imports (#285)
* enable relative imports

* update per 1st review

* remove symlink stuffs

* fix cli run in make file

* make resolving import path explicit

* fix importDir
2020-05-22 13:57:38 -07:00
Ozan Hacıbekiroğlu
e6689015df
Fix nested file imports (#282)
* fix nested file import

* better bytes prefix check

* remove comment
2020-05-19 07:24:03 -07:00
Ozan Hacıbekiroğlu
50379940e4
add shebang support (#274)
* add shebang support
2020-05-08 19:09:44 +02:00
daniel
d5b24138d3
add go module v2 (#244) 2019-12-29 13:38:51 -08:00
daniel
a9a233a750
fix internal package issue (#241)
* fix internal package issue

* ExampleSimple -> Example
2019-12-24 07:42:30 -08:00
daniel
c88a5f506e
some code clean up (#237) 2019-12-20 11:40:38 -08:00
Daniel
3c30109cd0
fix bytecode encoding/decoding of builtin modules (#154)
* fix bytecode encoding/decoding of builtin modules

* Bytecode.Decode() to take map[string]objects.Importable

* add objects.ModuleMap

* update docs

* stdlib.GetModuleMap()
2019-03-20 01:28:40 -07:00
Daniel
61890b15cb
module refactor (#148)
* wip

* move print and JSON functions to modules

* builtin functions are not replacable now

* builtin functions are added for default nil symbol table

* importables: builtin modules and source modules

* refactoring runtime tests

* fix tests

* update documentation

* cleanup

* clean up cli

* fix REPL prints
2019-03-18 08:15:26 -07:00
earncef
052ae5906b Refactored duplicate REPL code (#145)
* Refactored duplicate REPL code

* Cleanup

* Added comments

* Added repl.Options

* Added comment

* Clenaup

* Cleanup
2019-03-16 13:58:08 -07:00
earncef
5d8457a8f6 Removed double indirection for massive performance gains (#140)
* Removed double indirection for performance gains

* Added missing file

* Cleanup

* Remove pointers patch.

* Cleanup

* Removed redundant parenthesis

* FreeVar changed to ObjectPtr and removed OpSetLocalPtr

* Removed truePtr, falsePtr and undefinedPtr

* Cleanup
2019-03-14 01:07:19 -07:00
Daniel
e93f6f6325
limit max object allocations (#129)
- add object.NumObjects()
- add object allocation limit in VM
- delete objects.Break, objects.Continue, objects.ReturnValue
- add Script.SetMaxAllocs()
- update sandbox documentation
- add some tests
- remove duplicate values in compiled constants (fixes #96)
- option to limit the maximum number of objects in compiled bytecode constants
2019-03-06 17:20:05 -08:00
earncef
c437def4a0 Decoupled stdlib from vm, script and compiler (#126)
* Decoupled stdlib from script

* Decoupled compiler and vm from stdlib

* cleanup

* Docs and cleanup

* main package with and without stdlib

* cleanup

* Update .goreleaser
2019-03-04 10:21:39 -08:00
earncef
7cc683e867 SetBuiltinFunctions and SetBuiltinModules (#120)
* `SetBuiltinFunctions` and `SetBuiltinModules`

* nil implies no built in functions.

* Additional tests.

* Cleanup

* Updated SetBuiltinFunctions

* Docs updated.
2019-02-28 08:26:25 -08:00
earncef
5816186821 parser.ParseFile removed (#117)
* parser.ParseFile removed

* return values
2019-02-25 22:52:08 -08:00
earncef
6dd573c3f6 Runtime error trace format (#111)
* Runtime error format

* Parser and Compiler error formats updated
2019-02-22 13:39:07 -08:00
Daniel
3500c686b3
Improvements on compiler/VM error reporting (filename:line:col)
- add type infos to VM error messages
- add 'Name' to UserFunction objects 
- add 'expectErrorString' to VM tests
- replace vm.expectError() with vm.expectErrorString() to make it more explicit
- add source map info to VM error messages
- optimization in function calls
- add file/line/col info to compiler errors
- change stdlib module to be loaded from VM (instead of compiler) so they can be properly loaded after the source is compiled into binary
- VM can take builtin modules optionally
2019-02-20 16:26:11 -08:00
Daniel
9c67444678
Fixes a REPL bug (Issue #91) (#92) 2019-02-10 00:32:37 -08:00
Daniel Kang
806ddeba3d fix CLI version command 2019-01-30 01:31:41 -08:00
Daniel Kang
0e9c5231a5 1. fix bytecode compile bug 2. update CLI 2019-01-30 01:21:26 -08:00
Daniel Kang
a8d838ad3e Compile can take custom stdlibs 2019-01-18 09:19:45 -08:00
Daniel Kang
b79fd4f7ef
Fix lint issues (#2)
* addressing golint issues

* fix all lint issues.
2019-01-14 22:24:33 -08:00
Daniel Kang
a81295c0af update README, remove some unnecessary code 2019-01-12 22:58:12 -08:00
Daniel Kang
2de0fa4efb minor tengo tool help change 2019-01-12 18:10:21 -08:00
Daniel Kang
7e88e104c8 combine REPL and tengo tool 2019-01-12 17:02:15 -08:00
Daniel Kang
7289d767d4 add compile-run to "tengo" tool 2019-01-12 00:19:08 -08:00
Daniel Kang
27438eea6f update directory package structure 2019-01-11 02:27:28 -08:00
Daniel Kang
928a728f78 initial version of "tengo" CLI tool 2019-01-09 13:49:50 -08:00