Go to file
2018-12-18 14:32:59 -05:00
ast Update stdlib 2018-12-12 21:01:20 +00: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@f4647c6309 Update cpp-jsonnet and bump version to 0.12.0 2018-12-18 14:32:59 -05:00
dump godoc.org-compatible ast package 2018-04-12 14:06:52 -04:00
jsonnet Make automatically creating output dirs an option 2018-12-12 21:01:20 +00:00
linter Apply more golint recommendations (#201) 2018-02-28 01:11:18 -05:00
parser pull Local.Binds[].Body out via specialChildren (#232) 2018-06-11 21:06:59 -04:00
std Update stdlib 2018-12-12 21:01:20 +00:00
testdata std.parseJson - a builtin for parsing json 2018-12-13 13:45:39 -05: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 Adds TravisCI releaes process 2018-06-22 14:14:14 -04:00
builtins.go std.parseJson - a builtin for parsing json 2018-12-13 13:45:39 -05: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
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 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 Fix build instructions 2018-09-24 18:36:56 -04: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 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
travisBuild.sh travis: Support building pushed branches 2018-09-24 10:47:07 -04:00
value.go Internal refactor to improve performance (#225) 2018-06-01 10:52:20 -04:00
vm.go Update cpp-jsonnet and bump version to 0.12.0 2018-12-18 14:32:59 -05: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/fatih/color
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