We used to treat dummy paths like <stdin>, <std>, <extvar> as
real import locations, which causes obvious problem for importers.
After this change we consistently pass "" (an empty string) as location
for non-imported paths.
We exposed new functions to properly handle all paths.
The first function family, EvaluateFile* which allow evaluating
a Jsonnet program at a specified importable path. It should
be used in most cases.
The second function family, EvaluateAnonymousSnippet* allows evaluating
a snippet without an importable path. It should be used for situations
like the code passed as a commandline argument, stdin, etc.
The old function family, EvaluateSnippet* is now deprecated, but
works the same as before, i.e. the passed filenames are treated
as imported paths.
Changes are required to custom importers to make sure they satisfy
the refined contract.
Fixes#329.
* Renamed jsonValue obj field to val
* Renamed jsonValue children field to owned + added an explicit comment about this field
* Got rid of unnecessary vm handle checks
* Renamed arg to param, identifiers to paramNames
* Raised maxID value to 100 000
* Removed freedIDs entry check
* Fixed jsonnet_json_array_append, jsonnet_json_object_append bugs
* jsonValue now stores the list of related struct_JsonnetJsonValue
instead of handles ids
The initially empty ast.StdAst was created to break the circular
dependency. The generation of stdlib AST used to depend on
the primary "jsonnet" package, which meant that "jsonnet"
could not depend on it directly. Hence stdlib needed to be put
in the ast package. Now dumpstdlibast no longer depends on Jsonnet,
so we can get rid of this complication.
All code using ast.StdAst should now use astgen.StdAst.
Before this change updating BUILD.bazel file with Gazelle
would add `c-bindings/libgojsonnet.h` to `srcs/`.
It was prevented manually, but someone is going to let it slip
in at some point, so it's better to just not include it there
in the first place.
Treating the "cpp-jsonnet" Git submodule as a separate local Bazel
repository precludes use of the "go-jsonnet" repository from other
workspaces, as Bazel misinterprets the relative path to the local
"cpp-jsonnet" repository. Instead, use the Git submodule content
directly along the package path from the workspace root.
* Minimal C bindings
* Fix version reporting in C bindings
* Apply suggestions about C bindings implementation
* Rename compat/ -> c-bindings/
* Add comment about indexing VMs in C bindings