Commit Graph

386 Commits

Author SHA1 Message Date
Liang Mingqiang
aeda6138e5 experiment dump ast to source code (#101)
* Add facility to dump part of Go heap as Go code.

* Generate stdlib AST as Go code

* Use hardcoded stdlib AST instead of parsing it
2017-11-07 23:31:11 -05:00
Dave Cunningham
c60056c75f
Feature-complete commandline interface (#138)
* Feature-complete commandline interface
* Make errors match cpp implementation
2017-11-03 22:00:30 -04:00
Dave Cunningham
b6ee2c2f51
String token end location off-by-one error (#139)
* String token end location off-by-one error
2017-11-03 21:36:31 -04:00
Dave Cunningham
d753072f4e
Stdlib go generate (#144)
* run go generate for new stdlib
2017-11-03 00:56:08 -04:00
Dave Cunningham
e72d930647
update stdlib (#143) 2017-11-03 00:46:13 -04:00
Dave Cunningham
fd1eaa9e36
tell tests which implementation we are using (#142) 2017-11-03 00:41:40 -04:00
Dave Cunningham
dbc7fb3dc2
search jpaths from right to left, compatibility with cpp (#140) 2017-11-03 00:33:43 -04:00
Dave Cunningham
4356f42578
max_trace==0 means no trace limit (#141) 2017-11-03 00:33:31 -04:00
Dave Cunningham
f965f9ee04
For compatability, emit the \n within the library, not the cmd (#137)
* For compatability, emit the \n within the library, not the commandline tool
* Also add manifestString to library
2017-10-29 21:41:01 -04:00
Dave Cunningham
3eaf189897 Allow bitwise operations on floats, according to Spec (and Javascript behavior) 2017-10-26 20:26:16 -04:00
Dave Cunningham
e8f6d25f61 Add Version() 2017-10-25 20:19:19 -04:00
Dave Cunningham
968ae23435 Make NativeFunction members public (#135)
* Make NativeFunction members public
2017-10-24 23:00:40 -04:00
Alex Clemmer
52d2fdcfde Rename jsonnet.nativeFunction -> jsonnet.NativeFunction
Currently, `jsonnet.VM#NativeFunction` takes a single argument of type
`jsonnet.nativeFunction`. This is ok for internal use, but because this
type is private to the `jsonnet` package, it is not possible for a
third party to call this function (since it can't instantiate the type).

This commit makes this type public to remedy this problem.
2017-10-24 21:53:52 -04:00
Stanisław Barzowski
10d377f068 [WIP] Disallow floating point indexing (waiting for #116) 2017-10-14 00:49:04 -04:00
Stanisław Barzowski
bb8d424f73 Add previously forgotten tests 2017-10-13 19:55:24 -04:00
Dave Cunningham
5ff7ee047d Update README.md 2017-10-13 19:55:06 -04:00
Dave Cunningham
f3cb9eb8cf Rename 'ast' variable that shadowed package name. 2017-10-13 17:03:01 -04:00
Stanisław Barzowski
ed281bc563 Support for native callbacks 2017-10-13 15:49:06 -04:00
Stanisław Barzowski
96a2abc46c Some initial test metadata
It will be useful for properly testing TLAs, import callbacks etc.
2017-10-13 15:34:00 -04:00
Stanisław Barzowski
5c946dfb76 Eliminate duplication in builtin names
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.
2017-10-13 15:33:34 -04:00
Stanisław Barzowski
0f049eaa38 Basic tailstrict support 2017-10-13 15:33:23 -04:00
Stanisław Barzowski
2db3d1c3cc TLA support 2017-10-12 20:00:45 -04:00
Stanisław Barzowski
171cdd67f9 Post-rebase fix
Dead code removed in one branch, ended up being used in another.
2017-10-10 18:57:58 -04:00
Stanisław Barzowski
4b0735826d Rename valueSimpleObjectField -> simpleObjectField
A field on it's own is not a value
2017-10-10 00:31:49 -04:00
Stanisław Barzowski
0c43340142 Support for import callbacks
It was already there, it was a matter of exposing it in the API
2017-10-10 00:31:02 -04:00
Stanisław Barzowski
5b1798233c Represent types as Go objects, not strings (give them pointer identity) (#119)
Faster comparisons and IMO cleaner feeling overall.
It doesn't affect behaviour in any way.
2017-10-10 00:11:36 -04:00
Stanisław Barzowski
4a4a7fe459 Check index types (#116)
Before it would just crash
2017-10-10 00:09:32 -04:00
Stanisław Barzowski
ba0f236b14 Optional eval (#92)
* Optional arguments
2017-10-10 00:06:14 -04:00
Stanisław Barzowski
f0f70419f8 Clean up some TODOs
Some were stale, some were transformed into issues, some were fixed
2017-10-05 22:13:09 -04:00
Stanisław Barzowski
a4058fc177 Support for stack trace size limit 2017-10-05 03:31:16 -04:00
Stanisław Barzowski
02a4eed22d Support $ in comprehesions, fixes #68 2017-10-03 19:51:01 -04:00
Stanisław Barzowski
0ec5f40a58 Express at-most-once evaluation (thunk caching) in types 2017-10-03 19:50:12 -04:00
Stanisław Barzowski
94797696a9 Remove commented out code 2017-10-03 15:17:43 -04:00
Stanisław Barzowski
774715b3cf Support for std.thisFile, fixes #91.
Sadly it means that std in no longer the same object in each file.
2017-10-03 15:17:43 -04:00
Stanisław Barzowski
82f213a1e3 Fix tests (after rebase) 2017-10-03 15:17:32 -04:00
Stanisław Barzowski
8b843564bf Support --ext-str and --ext-code options 2017-10-03 14:31:53 -04:00
Stanisław Barzowski
33377907ec Allow all kinds of string literals as object field names 2017-10-03 14:30:32 -04:00
Stanisław Barzowski
80ce6ac112 Don't escape block strings (#98)
* Don't escape block strings
2017-10-03 14:29:12 -04:00
Stanisław Barzowski
c3459153df Location, error formatting and stack trace improvements (#59)
* 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
2017-10-03 14:27:44 -04:00
Stanisław Barzowski
a1b8248e84 Fix comprehensions (#90)
* Fix comprehensions

Only first and last forspec was used due to a parser bug.
2017-09-29 23:33:55 -04:00
Stanisław Barzowski
df1b805c96 More tests for builtins. 2017-09-29 22:57:31 -04:00
Stanisław Barzowski
ec94dec214 Remove stale TODOs 2017-09-29 12:36:29 -04:00
Stanisław Barzowski
e7249a1131 Separate manifestation from serialization to string
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.
2017-09-29 12:36:29 -04:00
Stanisław Barzowski
8628b9b4f9 Remove go:generate causing errors 2017-09-29 12:36:04 -04:00
mqliang
c2229ed262 eliminate ununsed code 2017-09-29 12:35:37 -04:00
Stanisław Barzowski
0b52ea4d40 Support for various kinds of strings in imports 2017-09-29 12:34:21 -04:00
Stanisław Barzowski
121a77c66f Remove a few stale TODOs 2017-09-29 12:32:44 -04:00
Stanisław Barzowski
b1a9c0bd6d ExtVar support 2017-09-28 23:14:53 -04:00
Stanisław Barzowski
0c86c9e109 Support of +:, in, in super
Also profiling
2017-09-28 22:21:46 -04:00
Stanisław Barzowski
93bcf64454 Add tests for std.primitiveEquals 2017-09-27 23:07:33 -04:00