Commit graph

70 commits

Author SHA1 Message Date
Aman Gupta Karmani
92cbb9bff0
Use any instead of interface{} (#419) 2023-08-22 09:56:27 +05:30
liuxiong
0177bdb4e1
fix json.indent docs (#429) 2023-08-22 09:45:00 +05:30
Mikael Ganehag Brorsson
82b543fd98
Better support for TZ locations in the times module (#397)
* Handle panics by deferring recover as an error

* Check for type in recover handler

* Added support for times.in_location

* Added support for location (TZ) to times.date

* Updated documentation
2023-01-31 09:51:04 +00:00
Wannes
ecc3d9181e
Added more math consts (#404) 2023-01-30 08:12:28 +00:00
skelly
2edd39e0c3
Update objects.md (#401) 2023-01-30 06:43:17 +00:00
Nicolas Stenberg-Daniil
f90d433d21
Corrected/changed variable names of the base64 and hex imports (instead of fmt) to correspond with the module name itself. (#375) 2022-04-15 18:38:56 +01:00
Michał Idzikowski
7b5d207914
fix documentation for enum.filter (#359)
* fix documentation for enum.filter

fixes https://github.com/d5/tengo/issues/358

* update stdlib code comment for enum.filter
2022-02-06 22:53:27 -08:00
KEINOS
4846cf5243
add custom extension support for importing source file (#350)
* chore: add tests for custom extension

* feat: cusom source extension #286

* fix: path to test directory

* add getter + change setter name for file extension

* add tests of source file extension validation

* fix: add validation for file extension names

* fix: property importExt -> importFileExt

* fix: redundant check (no resetting)

* fix: failing test wich did not follow the new spec

* chore: add detailed description of the test

* chore: fix doc comment to be descriptive

* docs: add note about customizing the file extension
2021-11-13 15:13:39 -08:00
Bruno Franca dos Reis
3b65ddf2b8
Extract ModuleGetter interface for dynamic imports (#349)
* Extract ModuleGetter interface for dynamic imports

* ModuleGetter: add example in interop doc.
2021-11-06 17:34:48 -07:00
Ozan Hacıbekiroğlu
7834251c84
spread last call argument v2 (#302) 2020-06-08 18:54:24 +02:00
Ozan Hacıbekiroğlu
366c69902f
add string comparison support (#294)
* enable relative imports

* update per 1st review

* remove symlink stuffs

* fix cli run in make file

* make resolving import path explicit

* fix importDir

* add string comparison operators

* fix duplicates
2020-05-25 10:53:52 -07:00
Ozan Hacıbekiroğlu
50379940e4
add shebang support (#274)
* add shebang support
2020-05-08 19:09:44 +02:00
Sébastien Lacoste
b555842004
fix typo in objects doc (#256) 2020-03-09 14:40:39 +01:00
Ozan HACIBEKİROĞLU
a053476c0b
fix markdownlint warnings (#255) 2020-03-04 15:53:38 +01:00
Ozan HACIBEKİROĞLU
73b5e6256e
builtin splice (#254)
* added builtin splice

* fix splice

* remove splice negative index
2020-03-03 22:16:15 -08:00
Ozan HACIBEKİROĞLU
ac534053e8
builtin delete for maps and arrays (#250)
* added builtin delete function and unit tests

* added vm tests for builtin delete

* added doc for builtin delete

* update doc
2020-02-19 15:02:31 +01:00
daniel
d5b24138d3
add go module v2 (#244) 2019-12-29 13:38:51 -08:00
daniel
c88a5f506e
some code clean up (#237) 2019-12-20 11:40:38 -08:00
Kazushi Kitaya
ad3980e4d0 replace outdated ErrInvalidTypeConversion in docs/objects.md (#223) 2019-10-24 10:19:02 +02:00
Brandon Buck
c3e41c2588 Correct misattributed string() details (#222)
* Correct misattributed `string()` details
2019-10-24 10:18:38 +02:00
Ma_124
1ee7425c9d Stdlib encodings: hex, base64 (#216) (#221)
* stdlib/hex and stdlib/base64

* stdlib/hex and stdlib/base64: added docs
2019-08-09 13:36:45 -04:00
Jacob R. McCollum
adcf05d26f add variadic function parameters (#189)
* parsing variable function types

* finished variadic functions

* fix case where number of passed args to variadic function is 0

* remove extraneous OpVarArgs

* allow multiple variables in variadic function declaration

* fix IdentList string method to print multi-arg variadic functions correctly

* round 2 of fix IdentList string method to print multi-arg variadic functions correctly

round 2 of fix IdentList string method to print multi-arg variadic functions correctly

* clean up tasks in OpCall handling, add tests for variadic closures

* cleanup for pr

- add syntax documentation
- cleanup parseIdentList
- cleanup OpCall handling for functions and closures
- cleanup tests
2019-04-25 21:28:27 -07:00
Daniel
2e0ea3a4c1
update syntax documentation (#186)
* Update tutorial.md

* Update tutorial.md

* Update tutorial.md

* Update tutorial.md

* Update tutorial.md

add logical operators, assignment operators, increment operators

* wip

* wip

* update
2019-04-18 23:33:23 -07:00
earncef
1ca10a7e3f Added formatting docs (#187) 2019-04-14 13:14:44 -07:00
earncef
bb07fa15b7 text.trim, text.pad_left and text.pad_right (#183)
* Added trim, pad_left and pad_right to text

* Check MaxStringLen

* Added doc

* Fixed doc

* Moved length check
2019-04-11 00:23:30 -07:00
earncef
0ae9a66e26 Fixed interoperability doc (#174) 2019-04-08 19:51:26 -07:00
Daniel
2cde0eaeea
json module faster implementation (#173)
* json module faster implementation

* add some decoding error test
2019-04-06 05:25:23 -07:00
Daniel
2f86800724
'enum' module (#166)
* 1. adding more methods to enum module
2. added ModuleMap.AddMap()
3. added bytes iterator

* add builtin functions 'is_enumerable' and 'is_array_like'

* builtin function 'is_iterable'

* first iteration on 'enum' module

* fix 'is_iterable' builtin function
2019-03-27 01:27:59 -07:00
Daniel
2b21c29bd3
update builtin function documentation (#159)
* Update builtins.md

* Update builtins.md

* Update builtins.md
2019-03-22 09:27:34 -07: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
ebddfd13a7 Added println (#144)
* Added println

* Fixed tests.

* Updated doc

* Fixed doc

* Cleanup

* Added size limit

* Fixed incorrect type

* Cleanup

* Consistent output for print and println
2019-03-16 00:14:22 -07:00
Daniel
b7977a419b
add Compiled.Clone to make them safe for concurrent execution (#134) 2019-03-08 01:10:49 -08: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
a3735846a5 Updated docs for SetBuiltinFunctions and SetBuiltinModules (#131)
* Updated docs for SetBuiltinFunctions and SetBuiltinModules

* minor update
2019-03-04 11:53:09 -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
Daniel
68cd38e49e
minor doc update
1. composite types -> compound types (#128)
2. composite assignment -> compound assignment
2019-03-03 15:21:28 -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
Daniel
fc4e3586c4
Fix a closure-block scope bug (#99)
* fix issue #98

* remove objects.CompiledModule

* remove objects.CompiledModule
2019-02-11 17:34:02 -08:00
earncef
5e21abfd74 IndexGet of Array, Index, ImmutableIndex, Bytes, String, Undefined 2019-02-09 16:45:21 -08:00
Daniel
2b517f376e
add 'rand' module (#90) 2019-02-09 12:33:35 -08:00
R.I.Pienaar
06c7e7df61 add os.readfile() 2019-02-07 21:58:47 +01:00
R.I.Pienaar
69961de7de add os.stat() and file.stat() 2019-02-06 15:20:41 +01:00
Daniel Kang
90aafc8bb4 Add 'is_function' and 'is_callable' builtin functions 2019-02-03 15:50:40 -08:00
Daniel Kang
eda0495f30 Fix several module-related issues 2019-02-02 22:22:40 -08:00
Daniel Kang
9c21c8a804 Fix a bug where user modules couldn't resolve builtin functions 2019-02-01 18:13:29 -08:00
Daniel Kang
9e73f40485 1. Added documentation on operators. 2. Add (char)-(int) operators 2019-02-01 16:58:44 -08:00
Daniel Kang
4f4646032c Update documentation for compiled scripts 2019-02-01 11:25:57 -08:00
Daniel Kang
44248b8c4b
Update interoperability.md 2019-01-31 01:14:47 -08:00
Daniel Kang
85d90f61ab
Update objects.md 2019-01-31 00:41:35 -08:00