Share std.jsonnet with cpp-jsonnet

So far `std.jsonnet` needed to be updated seprately from
the cpp-jsonnet submodule. Since we should update it anyway
at the same time (to make sure the tests are running fine),
we can just as well get it directly from there, eliminating
the extra step of copying the new `std.jsonnet` version.

This change updates the cpp-jsonnet used.
This commit is contained in:
Stanisław Barzowski 2019-04-12 12:28:07 +02:00
parent 2188e2d62a
commit c195e570ef
5 changed files with 11717 additions and 9515 deletions

View File

@ -58,10 +58,17 @@ export PATH=$PATH:$GOPATH/bin # If you haven't already
go generate
```
## Generated Stdlib
## Updating and modifying the standard library
To regenerate the standard library, do:
Standard library source code is kept in `cpp-jsonnet` submodule,
because it is shared with [Jsonnet C++
implementation](https://github.com/google/jsonnet).
For perfomance reasons we perform preprocessing on the standard library,
so for the changes to be visible, regeneration is necessary:
```bash
./reset_stdast_go.sh && go run cmd/dumpstdlibast/dumpstdlibast.go
```
The above command recreates `ast/stdast.go` which puts the desugared standard library into the right data structures, which lets us avoid the parsing overhead during execution.

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ func main() {
}
defer file.Close()
buf, err := ioutil.ReadFile("std/std.jsonnet")
buf, err := ioutil.ReadFile("cpp-jsonnet/stdlib/std.jsonnet")
if err != nil {
panic(err)
}

@ -1 +1 @@
Subproject commit d1da2275b6684dde0d9c4029dca56136fea9adbe
Subproject commit a1bcd6b9f0610f7f250c152944ee846efd718d3a

File diff suppressed because it is too large Load Diff