Commit Graph

94 Commits

Author SHA1 Message Date
Ludovic Fernandez
73afc090bb refactor: enhance consistency tests. (#53)
* test: remove limit.

* test: skip btln.go

* test: adds tests on errors.

* feat: add missing output results.

* refactor: time's tests.
2019-01-28 15:19:52 +01:00
Ludovic Fernandez
e78753ffd8 test: add consistency tests. (#46)
* test: add consistency tests.

* skip: cli1 due to bug.

* refactor: rename test.

* refactor: map and for.
2019-01-25 16:41:41 +01:00
Marc Vertes
5c79a97543 feat: add support for comparison of multiple types (#42)
The code for comparison operators is now generated by genop.
The support for multiple type has been added.
Missing operators <= and >= are now implemented.
2019-01-24 19:13:30 +01:00
Ludovic Fernandez
2fe2e8e754 refactor: use test package name. (#38)
* refactor: use test packake name.

* refactor: target and panic.
2019-01-24 11:40:33 +01:00
Ludovic Fernandez
4600a918f1 fix: missing tests. (#37) 2019-01-24 06:15:53 +01:00
Ludovic Fernandez
c09c1869a7 refactor: remove obsolete tests for plugins. (#36) 2019-01-24 06:14:31 +01:00
Marc Vertes
fe8c5191cd fix: implement missing defer of binary method (#33)
If the function to defer is a method of a binary object, the method
function must be resolved during defer. All other cases are already
handled.
2019-01-23 14:30:24 +01:00
Ludovic Fernandez
ed93935c93 refactor: custom GOPATH. (#32) 2019-01-23 13:04:19 +01:00
Ludovic Fernandez
3c674c2cc4 fix: remove hardcoded port. (#27)
* fix: remove hardcoded port.

* fix: genop.
2019-01-22 15:31:28 +01:00
Marc Vertes
08f4aabdc0 feat: generate operator functions (#25)
Add `cmd/genop` program to generate operator functions in `interp/op.go`.

For each operator, determine its type, handle argument types conversion if necessary.

Arithmetic operators are added for now. Assign and comparison operators coming in a next commit.
2019-01-22 14:10:28 +01:00
Marc Vertes
015bff1599 feat: handle recover builtin (#13)
The recovered state is stored in `Frame`, and captured in `runCfg()`.
`assign()` has been modified to set handle `interface{}` type (not
possible with `reflect`.
2019-01-17 21:15:10 +01:00
Marc Vertes
f4490ff851 Fix: multi-assign expression panic (#15)
* Fix: multi-assign expression panic

The following corrections are done:
* interp/ast.go: in case of ast.ValueSpec node, fix the decision between
multi-assign or single assign
* interp/cfg.go: in multi-assign parse, skip type symbol if it is
present
2019-01-17 20:59:45 +01:00
Marc Vertes
7987a97847 feat(ast): handle defer statement (#8) 2019-01-15 12:33:02 +01:00
Marc Vertes
bd15f88be6 feat: add support for select statement (#5)
* ast: improve error handling
* ast: handle select
* dyngo: set filename of executed script
* cfg: improve error reporting
* Implement select for receiving channels
* feat(select): add support for sending channels in case clauses
* test: improve tests on select
* feat(select): add support for "default" case
2019-01-09 17:45:38 +01:00
Marc Vertes
42e891da02 Fix DO NOT EDIT comment on generated files 2018-12-19 11:41:48 +01:00
Marc Vertes
b0ef0a00db Interpreter now exports itself, so scripts can do Eval() too 2018-12-11 10:29:43 -08:00
Marc Vertes
befbe23695 Load binary dependencies with Import() 2018-12-06 16:16:54 +01:00
Marc Vertes
4eab01911e Fix range for slices of binary objects 2018-12-02 17:46:27 +01:00
Marc Vertes
487e24e829 Type assertion: add support for 2nd return value 2018-12-01 17:56:55 +01:00
Marc Vertes
c75807dec9 Fix type assertions for runtime objects. Work in progress.
Function typeAssert() now returns the concrete value of interface{}
object defined in the runtime.

What is missing is actual type checking against provided type, and
support for the variant returning 2 values, the concrete value and
boolean status.
2018-12-01 14:49:56 +01:00
Marc Vertes
8bc2f14b78 Fix make to handle both runtime and interpreter defined types 2018-11-30 15:13:05 +01:00
Marc Vertes
5143f37a86 Handle dereference of boolean pointer. Uniformize boolean builtins 2018-11-30 12:08:01 +01:00
Marc Vertes
5c7b669fcc Fix handling chan boolean values 2018-11-29 19:28:12 +01:00
Marc Vertes
eb56b7dbb1 Fix handling array boolean values 2018-11-29 19:15:53 +01:00
Marc Vertes
18258dcd75 Fix handling map boolean values 2018-11-29 18:58:42 +01:00
Marc Vertes
1552194f11 Fix handling of boolean struct fields 2018-11-29 18:28:44 +01:00
Marc Vertes
a0b659fa8a Handle branching in boolean functions 2018-11-29 16:36:21 +01:00
Marc Vertes
5d490cf22b Fix frame init in node wrapper 2018-11-29 09:45:19 +01:00
Marc Vertes
c8fa453ce4 Fix init of zero objects 2018-11-28 17:27:46 +01:00
Marc Vertes
3bd853988b Automatic type conversion for maps and arrays 2018-11-27 15:19:40 +01:00
Marc Vertes
b20edb3b02 Fix handling of variadic arguments 2018-11-26 19:05:29 +01:00
Marc Vertes
84d8456b92 Fix solving selector expression on binary object 2018-11-20 12:21:01 +01:00
Marc Vertes
503b1d9119 Convert literal values to right type 2018-11-19 13:24:55 +01:00
Marc Vertes
0970329031 Convert literal values to right type 2018-11-19 10:27:54 +01:00
Marc Vertes
8a27260f27 Improve handling of pointer values 2018-11-13 17:56:39 +01:00
Marc Vertes
33c084f721 Fix negate operator 2018-11-13 15:47:54 +01:00
Marc Vertes
6637e21011 Fix a case where a global symbol was overwritten 2018-11-13 14:17:26 +01:00
Marc Vertes
c5abd4401d fix closure test 2018-11-08 11:35:28 +01:00
Marc Vertes
f2dccec382 Handle method call with receiver type conversion 2018-11-08 11:31:23 +01:00
Marc Vertes
80aa5f330d fix method assignement 2018-11-07 22:49:17 +01:00
Marc Vertes
314ceb15a7 Propagate method receiver info accross assignments 2018-11-05 15:55:14 +01:00
Marc Vertes
20ce2a13dc Improve handling of source file names 2018-11-01 10:05:12 +01:00
Marc Vertes
1592679f36 Rework function calls, in progress 2018-10-31 19:35:26 +01:00
Marc Vertes
799e832193 improve handling of closures (in progress) 2018-10-24 15:13:21 +02:00
Marc Vertes
69d81e61ae fix import test 2018-10-03 17:24:57 +02:00
Marc Vertes
81232a1fab Fix panic for empty statement block 2018-10-01 18:30:41 +02:00
Marc Vertes
335373164f get rid of sleep() 2018-09-27 14:00:41 +02:00
Marc Vertes
7eced03d66 Fix method resolution with pointers 2018-09-21 17:00:32 +02:00
Marc Vertes
5b05e06dca Fix method resolution when receiver type is delared later 2018-09-21 16:45:05 +02:00
Marc Vertes
b19876e4e2 fix out of order method resolution 2018-09-21 16:04:30 +02:00