-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Diversion from nix with splices in paths #44
Comments
Yup, that's a relatively new feature from the (not-yet released) Nix 2.4 :) May take a few weeks until I have time for this, so if you want to file a patch, feel free :) |
Ah I see, that makes sense.
I can try 😅 |
FYI I'm actively working on this now. |
Ma27
added a commit
that referenced
this issue
Nov 10, 2021
Since Nix 2.4 it's possible to perform string interpolations within paths: nix-repl> let a = "rnix"; in /home/ma27/Projects/${a}-parser /home/ma27/Projects/rnix-parser Please note that the following expressions are not supported (by both Nix and this patch): * `NIX_PATH` imports, i.e. `<nixpkgs/${foo}>` * Interpolations before the first slash, i.e. `foo${bar}/baz`. The newly introduced token `NODE_PATH_WITH_INTERPOL` is only used for these interpolated paths. Literal paths are still `TOKEN_PATH` inside `NODE_LITERAL` for backwards compatibility. Closes #44
Ma27
added a commit
that referenced
this issue
Dec 2, 2021
While working on #44 I had to split up the internal token-update behavior a bit as we have to decide which node to use (and also which behavior - depending on whether we have a "literal" path or a path with an interpolation). Unfortunately I wasn't careful enough with checking where trivia tokens (i.e. `\n`, ` ` etc.) were placed. This lead to situations such as TOKEN_WHITESPACE(" ") 37..38 TOKEN_WHITESPACE(" ") 38..39 NODE_LITERAL 39..44 { TOKEN_PATH("./bar") 39..44 where the second white-space should've been after the path `./bar`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Splicing/antiquoting in paths results in a syntax error, whereas Nix permits templated paths.
Code Snippet to reproduce
Expected behavior
The nix file is valid and should successfully evaluate to something like
/home/np/abc
.The text was updated successfully, but these errors were encountered: