Commit Graph

16 Commits

Author SHA1 Message Date
guoguangwu
04f3751f08
chore: remove refs to deprecated io/ioutil (#716) 2024-06-10 21:27:07 +01:00
Jesse
2655afd2bd
memory align structs (#635)
feat: align most structs and add lint rule to enforce struct alignment
2022-10-19 06:19:15 +01:00
Hanyu Cui
cd59751527
Distinguish go-jsonnet from cpp-jsonnet in version message (#497)
Distinguish the Go implementation in the version message
2021-01-13 20:46:15 +01:00
Stanisław Barzowski
4beab6633f Prevent keeping files open for too long.
Fixes #485.
2020-12-21 01:14:30 +01:00
Stanisław Barzowski
b70cbd441a Anonymous Import Locations
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.
2020-09-08 17:27:47 +02:00
Varun B Patil
2e346e53e7 jsonnet-deps: Jsonnet static dependency parser
Fixes #833
2020-08-08 19:59:36 +02:00
Robert Vollmert
678df37686 jsonnet --help: align consistently, break long lines
This fits the help text into 80 columns.
2020-07-02 23:04:34 +02:00
Robert Vollmert
e71d28e7c2 jsonnet --help: separate sections more clearly 2020-07-02 23:04:34 +02:00
Dave Cunningham
724650d358
Add native golang formatter (#388)
Add native golang formatter
2020-03-10 22:19:49 +00:00
Stanisław Barzowski
9ada769ce4 Make golangci-lint happy
Some of the suggestions are minor bug fixes (missing error handling).
2020-03-05 14:54:27 +01:00
Stanisław Barzowski
c77f22c99f Eliminate the unnecessary ast.StdAst
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.
2019-09-01 21:17:29 +02:00
Steve Harris
7614fd519c Correct a few complaints reported by "staticcheck" 2019-06-15 01:34:11 +02:00
Steve Harris
2e6c559964 Don't automatically install the std AST into "ast" 2019-06-15 01:34:11 +02:00
Steve Harris
7a5297a884 Dump standard library into "astgen" package
Export all fields in struct types in the "ast" package to allow
generating program source to reconstruct their complete values in a
separate package.
2019-06-15 01:34:11 +02:00
Dave Cunningham
df7753e2c7 Bring up-to-date with cpp version 2019-05-22 20:43:37 +01:00
Michael Schuett
2188e2d62a Add go mod / cleanup (#266)
Add go mod

Also make the build docs nicer and cleanup the file directory to be in line
with most other go projects. This also make it so you can build jsonnet
without setting -o on go build.
2019-04-03 15:46:19 +02:00