Commit Graph

16 Commits

Author SHA1 Message Date
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
098829d316 style: fix warnings from golangci-lint printed by make check (#11)
* style: fix warnings from golangci-lint printed by `make check`
* style: err assign in if block when possible. Better use of switch/case
* style: err assign in if block when possible
2019-01-16 18:59:24 +01:00
Marc Vertes
547b1afb8d feat(goexports): support multi os / arch, generate syscalls for all platforms (#6) 2019-01-11 17:41:26 +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
4a065cb4de Update dyngo to use interpreter REPL 2018-12-20 18:22:24 +01:00
Marc Vertes
97a03d8be1 repl: parse multiple line expressions 2018-12-20 15:23:34 +01:00
Marc Vertes
ed5fa33ea2 Add -i flag to start an REPL after eval file 2018-12-18 19:14:55 +01:00
Marc Vertes
f8a4aba39b Add interpreter inception example 2018-12-11 17:23:24 -08:00
Marc Vertes
b0ef0a00db Interpreter now exports itself, so scripts can do Eval() too 2018-12-11 10:29:43 -08:00
Marc Vertes
6a397e2294 Fix golint warnings 2018-12-07 17:37:58 +01:00
Marc Vertes
ea07c12f56 Support incremental parse and eval, and interactive mode 2018-12-07 17:16:11 +01:00
Marc Vertes
befbe23695 Load binary dependencies with Import() 2018-12-06 16:16:54 +01:00
Marc Vertes
6b013ffd35 Simplify export to runtime 2018-12-04 15:14:02 +01:00
Marc Vertes
20ce2a13dc Improve handling of source file names 2018-11-01 10:05:12 +01:00
Marc Vertes
25adc35a3c Change representation of stdlib from interface{} to reflect.Value
This fixes problems due to storing binary symbols as interfaces{}
instead of concrete type, which confuses lookup functions to retrieve
methods etc. in reflect.
2018-08-28 03:12:28 +02:00
Marc Vertes
b1c8ec4aaa s/gi/dyngo/ 2018-08-14 15:39:37 +02:00