Commit 6e47a40
starlark/lib/json: a JSON module for Starlark
This CL ports the go.starlark.net/starlarkjson module from Go to Java.
The json module provides four functions:
json.decode
json.encode
json.indent (not yet implemented)
json.encode_indent (not yet implemented)
It is tested through eval.ScriptTest, which adds the json module to
its environment, along with 'struct', a simple struct-like type.
Some tests are commented out, awaiting StarlarkFloat, or richer string support.
This is a first step towards removing Bazel's struct.to_json.
Updates bazelbuild/starlark#83
PiperOrigin-RevId: 3379444891 parent 6cb560f commit 6e47a40
6 files changed
+931
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
0 commit comments