Go to file
Dave Cunningham f965f9ee04
For compatability, emit the \n within the library, not the cmd (#137)
* For compatability, emit the \n within the library, not the commandline tool
* Also add manifestString to library
2017-10-29 21:41:01 -04:00
ast Optional eval (#92) 2017-10-10 00:06:14 -04: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
jsonnet For compatability, emit the \n within the library, not the cmd (#137) 2017-10-29 21:41:01 -04:00
parser Optional eval (#92) 2017-10-10 00:06:14 -04:00
std Interpreter & runtime - minimal usable version (#24) 2017-08-24 20:09:10 -04:00
testdata Allow bitwise operations on floats, according to Spec (and Javascript behavior) 2017-10-26 20:26:16 -04:00
_gen.go Finish up blocking out the parser. 2016-03-01 17:08:35 -08:00
.gitignore Optional eval (#92) 2017-10-10 00:06:14 -04:00
.travis.yml travis: update go version 2017-09-19 23:48:34 -04:00
builtins.go For compatability, emit the \n within the library, not the cmd (#137) 2017-10-29 21:41:01 -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 Support for native callbacks 2017-10-13 15:49:06 -04:00
doc.go Remove go:generate causing errors 2017-09-29 12:36:04 -04:00
error_formatter.go Clean up some TODOs 2017-10-05 22:13:09 -04:00
evaluator.go Allow bitwise operations on floats, according to Spec (and Javascript behavior) 2017-10-26 20:26:16 -04:00
imports.go Support for import callbacks 2017-10-10 00:31:02 -04:00
interpreter_test.go First end-to-end test (addition of numbers) 2016-03-08 01:17:44 -05:00
interpreter.go For compatability, emit the \n within the library, not the cmd (#137) 2017-10-29 21:41:01 -04:00
LICENSE Add CONTRIBUTING, add newline to end of other files 2016-02-19 17:36:19 -05:00
main_test.go For compatability, emit the \n within the library, not the cmd (#137) 2017-10-29 21:41:01 -04:00
mutually_recursive_defaults.input Optional eval (#92) 2017-10-10 00:06:14 -04:00
README.md Update README.md 2017-10-13 19:55:06 -04:00
runtime_error.go Location, error formatting and stack trace improvements (#59) 2017-10-03 14:27:44 -04:00
static_analyzer_test.go Move AST to its own package 2017-08-25 00:30:56 -04:00
static_analyzer.go Optional eval (#92) 2017-10-10 00:06:14 -04:00
std.go Interpreter & runtime - minimal usable version (#24) 2017-08-24 20:09:10 -04:00
std.thisFile.jsonnet Optional eval (#92) 2017-10-10 00:06:14 -04:00
tests.sh Support --ext-str and --ext-code options 2017-10-03 14:31:53 -04:00
thunks.go Make NativeFunction members public (#135) 2017-10-24 23:00:40 -04:00
value.go Basic tailstrict support 2017-10-13 15:33:23 -04:00
vm.go For compatability, emit the \n within the library, not the cmd (#137) 2017-10-29 21:41:01 -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.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