208 Commits

Author SHA1 Message Date
Dave Cunningham
493c45a403 Update cpp-jsonnet and bump version to 0.12.0 v0.12.1 v0.12.0 2018-12-18 14:32:59 -05:00
Dave Cunningham
ff0c19aa29 Update cpp-jsonnet 2018-12-18 13:42:53 -05:00
Stanisław Barzowski
767f100fd6 std.parseJson - a builtin for parsing json 2018-12-13 13:45:39 -05:00
Stanisław Barzowski
7012604878 Update stdlib 2018-12-12 21:01:20 +00:00
Lorenz Brun
d7fa222766 Update cpp-jsonnet to fix tests 2018-12-12 21:01:20 +00:00
Lorenz Brun
08080da8e2 Make automatically creating output dirs an option 2018-12-12 21:01:20 +00:00
Lorenz Brun
4122e4436e Automatically create output folders 2018-12-12 21:01:20 +00:00
Stanisław Barzowski
9a9954af24 Fix lexing of "!$".
See issues
    * https://github.com/google/jsonnet/issues/503
    * https://github.com/google/jsonnet/issues/572
2018-10-25 12:45:07 +01:00
Gareth Rushgrove
2999f7d4f6 Fix build instructions
Without downloading the dependency the current instructions fail to build.
2018-09-24 18:36:56 -04:00
Damien Lespiau
f7fcba659c travis: Support building pushed branches
This commit refactors travisBuild.sh to support building pushed branched on top
of PRs and tags.

This was prompted by enabling travis on a forked repository. The devlopment
flow then becomes:
  - Fork google/go-jsonnet
  - Enable travis on fork repository
  - Push branch to forked repository
  - Travis runs on the pushed branch
  - Submit pull request once happy and tests pass in the forked repository

I tested 3 scenarii and they seem behave nicely:
  - Running CI for pushed branch
  - Running CI for tag
  - Running CI for a Pull Request

As a side note, the previous error path didn't work as intented:
  - The TRAVIS_PULL variable didn't exist
  - We weren't exiting with a non 0 value in the else branch, so the build
    succeeded instead of failing when travisBuild.sh didn't know what to do
    with the pushed branch
2018-09-24 10:47:07 -04:00
Dave Cunningham
6144c57d2a Update cpp-jsonnet & bump version v0.11.2 2018-07-19 16:09:27 -04:00
Dave Cunningham
b4603b0c32 match change to cpp version re: unrecognized native returning null 2018-07-19 14:32:32 -04:00
Dave Cunningham
c038cd37e7 update cpp 2018-07-19 14:32:32 -04:00
Lars Wander
43294caaef Fix build during release 2018-07-18 20:25:08 -04:00
Lars Wander
e01563f538 Adds TravisCI releaes process
Given the <tag> chosen in the GitHub releases page, this builds jsonnet
for darwin & linux amd64 (we can add more if needed), and uploads to
gs://jsonnet/<tag>/<os>/<arch>/jsonnet
2018-06-22 14:14:14 -04:00
Jameson
39887d9751 pull Local.Binds[].Body out via specialChildren (#232)
* pull Local.Binds[].Body out via specialChildren

* move Local.Body to special from direct
2018-06-11 21:06:59 -04:00
Dave Cunningham
95e1c1790a
Lex fodder in a manner compatible with C++ (#231)
* Lex fodder in a manner compatible with C++
2018-06-11 14:40:28 -04:00
Jameson Lee
a1964b49f1 support for traversing AST tree with parens and objectcomps 2018-06-06 02:06:10 -04:00
Stanisław Barzowski
46256581d7 Travis fix as suggested by @jamesonjlee (#230) 2018-06-05 14:20:48 -04:00
Dave Cunningham
2973e24152
Internal refactor to improve performance (#225)
* Internal refactor to improve performance
2018-06-01 10:52:20 -04:00
Stanisław Barzowski
530cf7b07c Implement operators == and != as builtins (#221)
People use these operators in tight loops, without even
thinking about it, and it's previous implementation required
multiple object lookups (std.), string comparisons (for types)
and multiple jsonnet function calls.

This change introduces builtin, efficient implementation.
It results in ~3x speedup in strContains benchmark that
Angus provided on Slack.

Additional benefit is that equals/primitiveEquals distinction
is now obsolete, which made things simpler for everyone.
2018-05-23 22:26:30 -04:00
Dave Cunningham
d9b833b8a0
Bump C++ version, implement std.trace, fix parsing of -$, update std (#224) 2018-05-23 22:24:12 -04:00
Luke Granger-Brown
643210d274 Add string output support for multifile output (#220)
* Add test support for multi-file output.

* Add -update support for multi-file output tests.

* Add support for string output in multi-file output mode.

* Rename 'stringOutput' to 'stringOutputMode' to better express what it does

* Refactor main_test to make it less nested.

This also causes the -update flag to output a list of files which
have been updated. This does not include the paths which are deleted
for multi-file tests.
2018-05-09 11:49:07 -04:00
Stanisław Barzowski
f4428e6d47 Better Importer interface
As discussed in https://github.com/google/go-jsonnet/issues/190
2018-04-28 01:34:42 -04:00
Roger Peppe
fde815f6a1 godoc.org-compatible ast package
Change the dump code so that it hides the values of variable
definitions if they're large. This means that godoc.org should
be able to deal with the output, and the godoc output is
readable without needing to read through a huge struct literal definition.

Other approaches might be to always generate an extra variable
(seems unnecessary) or to pass to writer explicitly to the dump
methods rather than swapping s.w out temporarily. The former
seems unnecessarily intrusive to the usual output; the latter
seemed unnecessarily intrusive to the source itself.
YMMV.
2018-04-12 14:06:52 -04:00
Dave Cunningham
dfddf2b4e3 Update version v0.10.0 2018-03-16 22:34:36 -04:00
Dave Cunningham
0b46b25f0f Update to cpp jsonnet 2018-03-16 22:20:53 -04:00
Dave Cunningham
6efde9677d Handle base case of cloneForSpec 2018-03-15 13:56:17 -04:00
Marcelo Cantos
b0459e4867 Add AppVeyor Windows builds and releases (#206)
* Make some filenames Windows-friendly

* Update references to renamed files

* Fix escaped filenames to run on non-Windows platforms
2018-03-12 20:46:57 -04:00
Marcelo Cantos
d67779ed8d Refactor handling of --{ext,tla}-* flags (#212)
* Refactor handling of --{ext,tla}-* flags

* better helper function names for --{ext,tla}-* flags
2018-03-11 16:44:59 -04:00
Dave Cunningham
405726fae2
Clone ASTs to avoid aliasing and double-unescaping (#210)
* Clone ASTs to avoid aliasing and double-unescaping
2018-03-07 11:23:32 -05:00
Dave Cunningham
5cc426ed04 Bring submodule and stdlib to cpp master 2018-03-06 23:49:02 -05:00
Marcelo Cantos
cf6933d45b Add C++-Jsonnet submodule for tests (#202)
* Add C++-Jsonnet submodule for tests
* Add tests.sh to travis-ci
2018-03-06 13:05:00 -05:00
Marcelo Cantos
88519c3704 Apply more golint recommendations (#201)
* Apply more golint recommendations

* Update dumpstdlibast.go to include StdAst comment

* Improve dump.go package comment.
2018-02-28 01:11:18 -05:00
Marcelo Cantos
ed5f280c59 Apply golint recommendations (#196)
* Apply golint recommendations
2018-02-26 14:12:25 -05:00
Marcelo Cantos
5ae4798d8d Clean up token strings 2018-02-25 13:41:11 -05:00
Stanisław Barzowski
44770e75dd Add std.sign and fix division by zero in stdlib 2018-02-21 20:31:04 -05:00
Petr Krebs
bed2cd89bc Do not assume that import path is always a filesystem path (do not clean it up) 2018-02-17 16:34:54 -05:00
Dave Cunningham
2ea01b24d8
Introduce a Parens AST (#189)
* Introduce a Parens AST
2018-02-16 13:01:14 -05:00
Dave Cunningham
f46dea2835 Update std.jsonnet 2018-02-01 14:21:39 -05:00
Stanisław Barzowski
61b33d1a2a Fast, native implementation of strReplace 2018-01-31 15:27:59 -05:00
Cam Hutchison
d1d9a7f5f8 Convert --tla/ext-*-file to imports
Instead of reading the files directly for --tla/ext-*-file, just add a
code snippet that does an import or importstr.

This makes relative imports work when the code-file path is not in the
current directory. It also makes the import lazy so if the arg/var is
not referenced, the file does not have to exist.

Fixes: google/jsonnet#452
2018-01-30 18:22:29 -05:00
Stanisław Barzowski
4406074d47 Add support for memory profiling 2018-01-27 18:44:54 -05:00
Stanisław Barzowski
eeecb7f100 Fix processing the same file many times
There was a trivial bug, which disabled caching
of parsed, desugared and analyzed code. So imports
were only cached on data level, not on executable
ast level.

This change will likely result in ~10x speedup
for some users.
2018-01-27 15:09:25 -05:00
Dave Cunningham
741f9f06a2 Update stdlib and ||| fix 2018-01-23 23:26:28 -05:00
Stanisław Barzowski
eedf6760ad Convert non-string errors to string 2018-01-18 12:48:38 -05:00
Stanisław Barzowski
d6623a98cb Oldest version known to work = Go 1.8, closes #177
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.
2018-01-18 12:48:20 -05:00
Stanisław Barzowski
d135effbe4 Add missing check for array out of bounds 2018-01-17 15:26:31 -05:00
Yewei Huang
561a986e8e Remove unnecessary type alias in jsonnet/cmd.go 2018-01-15 21:10:31 -05:00
Stanisław Barzowski
bc88189964 Very basic, experimental linter
No tests yet
2018-01-15 21:05:52 -05:00