It seems like it was broken on older compilers
since pregenerated stdlib AST.
It adds go 1.8.x to travis, so that we have a chance
of catching when our "known to work" no longer holds.
Actually there was one (objectFieldEx) that was inconsistent, i.e.
it was available by a different name from what appeared in the stack
trace. This is now fixed.
* Location, error formatting and stack trace improvements
* Static context for AST nodes
* Thunks no longer need `name`
* Prototype for showing snippets in error messages (old format still
available)
* Use ast.Function to represent methods and local function sugar.
* Change tests so that the error output is pretty
This is necessary for example for native functions
(which take json as arguments).
Standard "encoding/json" representation is used, but I have
mixed feeling about it. Not sure if treating json values as interface{}
is the right trade-off in our case.
Fix a bunch of bugs:
- Reverse meaning of boolean argument to objectFieldsEx and objectHasEx
- Slice desugaring using `std.slice` instead of `slice` as a field name.
Support + on string and something else.
Support + on arrays
assertEqual should now work properly
* Array comprehensions
Implemented using flatMap.
The representation in AST was changed - now it expresses
the semantic structure better.
Ifs in comprehensions are not supported yet, but easy.
* Interpreter & runtime - minimal usable version
Accomplishments in this commit:
* Majority of language features implemented:
* Unary operators
* Binary operators
* Conditionals
* Errors
* Indexing arrays
* Indexing objects
* Object inheritance
* Imports
* Functions
* Function calls
* There is a quite nice way for creating builtins
* Static analyzer is there with most of the functionality
* Standard library is included and parts unaffected by missing features
work
* Some bugs in existing parts fixed
* Most positive tests from C++ version pass, the rest is failing mostly
due to missing builtins and comprehensions.
* Some initial structure was created that should allow more incremental
and focused changes in the future PRs.
* Some comments/explanations added
* Panics translated to a little bit more gentle internal errors (with a
link to issues on github).
What still sucks:
* Stack traces & error messages (there's some stuff in place)
* Almost everything is in the same package
* Stuff is exported or unexporeted randomly (see above)
* Missing a few lexing/parsing features
* Missing builtins
* Missing support for extvars and top-level-args
* Checking function arguments is missing
* No clean Go API that commandline and compatibility layer to C can use
* No compatibility layer to C
* Assertions don't work (desugaring level, assertEquals works).
* Manifestation stack traces (and generally it could use some work).
* The way environments are constructed is sometimes suboptimal/clumsy.