mirror of
https://github.com/google/go-jsonnet.git
synced 2025-08-10 00:07:13 +02:00
|
||
---|---|---|
ast | ||
cmd | ||
compat | ||
compat_test | ||
dump | ||
jsonnet | ||
parser | ||
std | ||
testdata | ||
_gen.go | ||
.gitignore | ||
.travis.yml | ||
builtins.go | ||
CONTRIBUTING | ||
desugarer_test.go | ||
desugarer.go | ||
doc.go | ||
error_formatter.go | ||
evaluator.go | ||
imports.go | ||
interpreter_test.go | ||
interpreter.go | ||
LICENSE | ||
main_test.go | ||
mutually_recursive_defaults.input | ||
README.md | ||
reset_stdast_go.sh | ||
runtime_error.go | ||
static_analyzer_test.go | ||
static_analyzer.go | ||
std.go | ||
std.thisFile.jsonnet | ||
tests.sh | ||
thunks.go | ||
value.go | ||
vm.go |
go-jsonnet
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.6 and above.
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
}
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/mjibson/esc
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