mirror of
https://github.com/google/go-jsonnet.git
synced 2025-09-30 01:41:04 +02:00
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:
parent
2188e2d62a
commit
c195e570ef
11
README.md
11
README.md
@ -58,10 +58,17 @@ export PATH=$PATH:$GOPATH/bin # If you haven't already
|
|||||||
go generate
|
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
|
```bash
|
||||||
./reset_stdast_go.sh && go run cmd/dumpstdlibast/dumpstdlibast.go
|
./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.
|
||||||
|
19283
ast/stdast.go
19283
ast/stdast.go
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
buf, err := ioutil.ReadFile("std/std.jsonnet")
|
buf, err := ioutil.ReadFile("cpp-jsonnet/stdlib/std.jsonnet")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit d1da2275b6684dde0d9c4029dca56136fea9adbe
|
Subproject commit a1bcd6b9f0610f7f250c152944ee846efd718d3a
|
1326
std/std.jsonnet
1326
std/std.jsonnet
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user