Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to astexplorer in the spec #807

Open
sbarzowski opened this issue May 21, 2020 · 3 comments
Open

Link to astexplorer in the spec #807

sbarzowski opened this issue May 21, 2020 · 3 comments

Comments

@sbarzowski
Copy link
Collaborator

@Alxandr implemented AST Explorer plugin for Jsonnet. It may be pretty useful for tooling development.

More details in #804.

@Alxandr
Copy link

Alxandr commented May 21, 2020

Do note that this is a parser I made, and has not been vetted. There are definitely some rough edges (especially around errors in the input), and it currently does not deal well with slices a[from:to:step].

On a side-note, I'm also planning to look at an LSP implementation.

@Alxandr
Copy link

Alxandr commented May 22, 2020

FYI: fkling/astexplorer#505

@Alxandr
Copy link

Alxandr commented May 24, 2020

I also added a transformer to the core language to astexplorer. It can be seen here. Pick jsonnet as language, and pick core language in the transformer list. The core language visualization is custom, as is the core language itself. It's fairly true to the core language described in the spec, with the exceptions that I

  1. bind variables (so unique variables have unique identities).
  2. keep import statements.
  3. keep the +: (and similar) operators for object fields.

I'm not sure I've done all the desugaring correctly, so I made this to make it easier to see what the output of the desugaring was. If you feel like, feel free to test it out and report discrepancies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants