Go to file
2019-06-04 16:55:43 +01:00
ast Bring up-to-date with cpp version 2019-05-22 20:43:37 +01:00
c-bindings Minimal C bindings (#257) 2019-03-16 17:47:12 -04:00
c-bindings-tests Minimal C bindings (#257) 2019-03-16 17:47:12 -04:00
cmd Bring up-to-date with cpp version 2019-05-22 20:43:37 +01:00
cpp-jsonnet@d192671391 Update for version v0.13.0 2019-06-03 18:46:24 +01:00
dump godoc.org-compatible ast package 2018-04-12 14:06:52 -04:00
linter Apply more golint recommendations (#201) 2018-02-28 01:11:18 -05:00
parser Add basic tests for Children and add missing cases 2019-03-20 10:23:24 -04:00
testdata Change golden files back again; 2019-06-04 16:55:43 +01:00
.gitignore Add go mod / cleanup (#266) 2019-04-03 15:46:19 +02:00
.gitmodules Add C++-Jsonnet submodule for tests (#202) 2018-03-06 13:05:00 -05:00
.travis.yml Adds TravisCI releaes process 2018-06-22 14:14:14 -04:00
builtins.go Proper env for obj locals in comprehensions 2019-05-13 17:42:04 +02:00
CONTRIBUTING Add CONTRIBUTING, add newline to end of other files 2016-02-19 17:36:19 -05:00
desugarer_test.go First end-to-end test (addition of numbers) 2016-03-08 01:17:44 -05:00
desugarer.go Keep object locals only once in AST (#263) 2019-05-07 22:43:55 +02:00
doc.go Remove go:generate causing errors 2017-09-29 12:36:04 -04:00
error_formatter.go Apply golint recommendations (#196) 2018-02-26 14:12:25 -05:00
go.mod Add go mod / cleanup (#266) 2019-04-03 15:46:19 +02:00
go.sum Add go mod / cleanup (#266) 2019-04-03 15:46:19 +02:00
imports.go Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
interpreter_test.go First end-to-end test (addition of numbers) 2016-03-08 01:17:44 -05:00
interpreter.go Keep object locals only once in AST (#263) 2019-05-07 22:43:55 +02:00
jsonnet_test.go Better Importer interface 2018-04-28 01:34:42 -04:00
key.json.enc Adds TravisCI releaes process 2018-06-22 14:14:14 -04:00
LICENSE Add CONTRIBUTING, add newline to end of other files 2016-02-19 17:36:19 -05:00
main_test.go Add basic tests for Children and add missing cases 2019-03-20 10:23:24 -04:00
mutually_recursive_defaults.input Optional eval (#92) 2017-10-10 00:06:14 -04:00
README.md Share std.jsonnet with cpp-jsonnet 2019-04-16 20:35:19 +02:00
release.sh Fix build during release 2018-07-18 20:25:08 -04:00
reset_stdast_go.sh Fix unparsing of enums, avoid static type error 2017-11-08 11:28:38 -05:00
runtime_error.go Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
static_analyzer_test.go Move AST to its own package 2017-08-25 00:30:56 -04:00
static_analyzer.go Keep object locals only once in AST (#263) 2019-05-07 22:43:55 +02:00
std.thisFile.jsonnet Optional eval (#92) 2017-10-10 00:06:14 -04:00
tests.sh Add go mod / cleanup (#266) 2019-04-03 15:46:19 +02:00
thunks.go Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
travisBuild.sh travis: Support building pushed branches 2018-09-24 10:47:07 -04:00
value.go Perform lookups from obj locals with right sb 2019-05-13 17:42:04 +02:00
vm.go Update for version v0.13.0 2019-06-03 18:46:24 +01:00

go-jsonnet

GoDoc Widget Travis Widget Coverage Status Widget

This an implementation of Jsonnet in pure Go. It is feature complete but is not as heavily exercised as the Jsonnet C++ implementation. Please try it out and give feedback.

This code is known to work on Go 1.8 and above. We recommend always using the newest stable release of Go.

Install instructions

go get github.com/google/go-jsonnet/cmd/jsonnet

Build instructions (go 1.11+)

git clone github.com/google/go-jsonnet
cd go-jsonnet
go build ./cmd/jsonnet

Build instructions (go 1.8 - 1.10)

go get -u github.com/google/go-jsonnet
cd $GOPATH/src/github.com/google/go-jsonnet
go get -u .
go build ./cmd/jsonnet

Running tests

./tests.sh  # Also runs `go test ./...`

Implementation Notes

We are generating some helper classes on types by using http://clipperhouse.github.io/gen/. Do the following to regenerate these if necessary:

go get github.com/clipperhouse/gen
go get github.com/clipperhouse/set
export PATH=$PATH:$GOPATH/bin  # If you haven't already
go generate

Updating and modifying the standard library

Standard library source code is kept in cpp-jsonnet submodule, because it is shared with Jsonnet C++ implementation.

For perfomance reasons we perform preprocessing on the standard library, so for the changes to be visible, regeneration is necessary:

./reset_stdast_go.sh && go run cmd/dumpstdlibast/dumpstdlibast.go

The above command recreates ast/stdast.go which puts the desugared standard library into the right data structures, which lets us avoid the parsing overhead during execution.