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

Nix/nickel #1067

Draft
wants to merge 73 commits into
base: master
Choose a base branch
from
Draft

Nix/nickel #1067

wants to merge 73 commits into from

Conversation

francois-caddet
Copy link
Contributor

This is the main branch for the developement of a nix compatibility for nickel.
The idea of this compatibility is to give Nickel the capacity to evaluate Nix expressions.
As first step we will focus on the evaluation of the core language, without standart lib.

@github-actions github-actions bot temporarily deployed to pull request January 26, 2023 10:12 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 26, 2023 10:26 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 27, 2023 14:52 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 27, 2023 15:39 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 29, 2023 23:02 Inactive
@github-actions github-actions bot temporarily deployed to pull request January 30, 2023 16:36 Inactive
francois-caddet and others added 22 commits March 8, 2023 11:00
- parse a let binding of type `let <IDENT> = <LITERAL>; in <IDENT>`
- can parse when multiple bindings in the let
- for now, concider every let as recursive let.
Have to translate nix let blocks to a nickel destructuring. Because
destructuring need a span, this commit make `FileId` required to parse
nix files. Also it was a good oportunity to add terms positions to
parsed terms.
patterns fields now.

tODO: update the pretty printer to print the full pattern an not only
the at binding. May be in a extra PR.
Make parsing of `record.${a field expr}` parsable.
It may not be parsed at term level but should not be an issue because it
effectively return a term and if not used at right place, the parser
will return an error anyway.
Co-authored-by: Yann Hamdaoui <[email protected]>
francois-caddet and others added 21 commits March 8, 2023 11:03
Add a filter to include `tests/nix/*.nix` files
in Nix `0.625` is not equivalant to `5/8`
even if it works in nickel, we prefer to stay correct and compare
frac with frac.
At the same time, it clean and simplify some parts of the code
Co-authored-by: Yann Hamdaoui <[email protected]>
Co-authored-by: Yann Hamdaoui <[email protected]>
- impl this trait for `rnix` operators and `SyntaxNode`
- others code cleaning
now able to evaluate `{...} ? <field_path>`
Identifiers require a position. So, we added it
- complex shadowing
- nested record combined with a with
- with and recursive record which does not pass for now  (check todos in
  `tests/nix/with.nix`)
@yannham yannham self-assigned this Mar 8, 2023
@github-actions github-actions bot temporarily deployed to pull request March 8, 2023 15:44 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 8, 2023 17:41 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 9, 2023 10:58 Inactive
@github-actions github-actions bot temporarily deployed to pull request March 9, 2023 11:30 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants