Go to file
2018-06-06 02:06:10 -04:00
ast Bump C++ version, implement std.trace, fix parsing of -$, update std (#224) 2018-05-23 22:24:12 -04:00
cmd Apply more golint recommendations (#201) 2018-02-28 01:11:18 -05:00
compat Support of +:, in, in super 2017-09-28 22:21:46 -04:00
compat_test Some placeholders and experiments for C library 2017-09-27 22:01:29 -04:00
cpp-jsonnet@aec4e0868b Bump C++ version, implement std.trace, fix parsing of -$, update std (#224) 2018-05-23 22:24:12 -04:00
dump godoc.org-compatible ast package 2018-04-12 14:06:52 -04:00
jsonnet Refactor handling of --{ext,tla}-* flags (#212) 2018-03-11 16:44:59 -04:00
linter Apply more golint recommendations (#201) 2018-02-28 01:11:18 -05:00
parser support for traversing AST tree with parens and objectcomps 2018-06-06 02:06:10 -04:00
std Bump C++ version, implement std.trace, fix parsing of -$, update std (#224) 2018-05-23 22:24:12 -04:00
testdata Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
.gitignore Very basic, experimental linter 2018-01-15 21:05:52 -05:00
.gitmodules Add C++-Jsonnet submodule for tests (#202) 2018-03-06 13:05:00 -05:00
.travis.yml Travis fix as suggested by @jamesonjlee (#230) 2018-06-05 14:20:48 -04:00
builtins.go Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04: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 Implement operators == and != as builtins (#221) 2018-05-23 22:26:30 -04: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
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 Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
jsonnet_test.go Better Importer interface 2018-04-28 01:34:42 -04:00
LICENSE Add CONTRIBUTING, add newline to end of other files 2016-02-19 17:36:19 -05:00
main_test.go Add string output support for multifile output (#220) 2018-05-09 11:49:07 -04:00
mutually_recursive_defaults.input Optional eval (#92) 2017-10-10 00:06:14 -04:00
README.md Add C++-Jsonnet submodule for tests (#202) 2018-03-06 13:05:00 -05: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 Apply more golint recommendations (#201) 2018-02-28 01:11:18 -05:00
std.thisFile.jsonnet Optional eval (#92) 2017-10-10 00:06:14 -04:00
tests.sh Bring submodule and stdlib to cpp master 2018-03-06 23:49:02 -05:00
thunks.go Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
value.go Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
vm.go Add string output support for multifile output (#220) 2018-05-09 11:49:07 -04: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.

Build instructions

export GOPATH=$HOME/go-workspace
mkdir -pv $GOPATH
go get github.com/google/go-jsonnet
cd $GOPATH/src/github.com/google/go-jsonnet
cd jsonnet
go build
./jsonnet /dev/stdin <<< '{x: 1, y: self.x} + {x: 10}'
{
   "x": 10,
   "y": 10
}

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

Generated Stdlib

To regenerate the standard library, do:

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