No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
garethr and sparkprime Fix build instructions
Without downloading the dependency the current instructions fail to build.
Latest commit 2999f7d Aug 19, 2018
Permalink
Failed to load latest commit information.
ast Lex fodder in a manner compatible with C++ (#231) Jun 11, 2018
cmd Apply more golint recommendations (#201) Feb 28, 2018
compat Support of +:, in, in super Sep 29, 2017
compat_test Some placeholders and experiments for C library Sep 28, 2017
cpp-jsonnet @ af6eea0 Update cpp-jsonnet & bump version Jul 19, 2018
dump godoc.org-compatible ast package Apr 12, 2018
jsonnet Refactor handling of --{ext,tla}-* flags (#212) Mar 11, 2018
linter Apply more golint recommendations (#201) Feb 28, 2018
parser pull Local.Binds[].Body out via specialChildren (#232) Jun 12, 2018
std Bump C++ version, implement std.trace, fix parsing of -$, update std (#… May 24, 2018
testdata match change to cpp version re: unrecognized native returning null Jul 19, 2018
.gitignore Very basic, experimental linter Jan 16, 2018
.gitmodules Add C++-Jsonnet submodule for tests (#202) Mar 6, 2018
.travis.yml Adds TravisCI releaes process Jun 22, 2018
CONTRIBUTING Add CONTRIBUTING, add newline to end of other files Feb 19, 2016
LICENSE Add CONTRIBUTING, add newline to end of other files Feb 19, 2016
README.md Fix build instructions Sep 24, 2018
builtins.go match change to cpp version re: unrecognized native returning null Jul 19, 2018
desugarer.go Implement operators == and != as builtins (#221) May 24, 2018
desugarer_test.go First end-to-end test (addition of numbers) Mar 8, 2016
doc.go Remove go:generate causing errors Sep 29, 2017
error_formatter.go Apply golint recommendations (#196) Feb 26, 2018
imports.go Internal refactor to improve performance (#225) Jun 1, 2018
interpreter.go Internal refactor to improve performance (#225) Jun 1, 2018
interpreter_test.go First end-to-end test (addition of numbers) Mar 8, 2016
jsonnet_test.go Better Importer interface Apr 28, 2018
key.json.enc Adds TravisCI releaes process Jun 22, 2018
main_test.go Add string output support for multifile output (#220) May 9, 2018
mutually_recursive_defaults.input Optional eval (#92) Oct 10, 2017
release.sh Fix build during release Jul 19, 2018
reset_stdast_go.sh Fix unparsing of enums, avoid static type error Nov 8, 2017
runtime_error.go Internal refactor to improve performance (#225) Jun 1, 2018
static_analyzer.go Apply more golint recommendations (#201) Feb 28, 2018
static_analyzer_test.go Move AST to its own package Aug 25, 2017
std.thisFile.jsonnet Optional eval (#92) Oct 10, 2017
tests.sh Bring submodule and stdlib to cpp master Mar 7, 2018
thunks.go Internal refactor to improve performance (#225) Jun 1, 2018
travisBuild.sh travis: Support building pushed branches Sep 24, 2018
value.go Internal refactor to improve performance (#225) Jun 1, 2018
vm.go Update cpp-jsonnet & bump version Jul 19, 2018

README.md

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