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

Wrong path parsing #68

Open
selfuryon opened this issue Jan 24, 2023 · 0 comments
Open

Wrong path parsing #68

selfuryon opened this issue Jan 24, 2023 · 0 comments

Comments

@selfuryon
Copy link

Hello!
If I have this attrset:

rec {
  name = "test";
  path = ./new/${name}.nix;
}

Statix can't parse it correctly:

 $ statix check test.nix
[bin/src/config.rs:79] [self.ignore.as_slice(), extra_ignores].concat() = []
[E00] Error: Syntax error
   ╭─[test.nix:3:24]
   │
 3 │ ╭─▶   path = ./new/${name}.nix;
 4 │ ├─▶ }
   · │
   · ╰─────── Unexpected TOKEN_PATH at 46..52, wanted any of [TOKEN_IDENT]
───╯
[E00] Error: Syntax error
   ╭─[test.nix:1:1]
   │
 1 │ rec {
   · │
   · ╰─ Unexpected end of file, wanted any of [TOKEN_IDENT]
───╯
[E00] Error: Syntax error
   ╭─[test.nix:1:1]
   │
 1 │ rec {
   · │
   · ╰─ Unexpected end of file, wanted any of [TOKEN_SEMICOLON]
───╯
[E00] Error: Syntax error
   ╭─[test.nix:1:1]
   │
 1 │ rec {
   · │
   · ╰─ Unexpected end of file

It seems like it doesn't work with ., because if I omit that it works fine. All of these variants works:

rec {
  name = "test";
  path1 = ./new/${name}nix;
  path2 = ./new/${name}/nix;
  path3 = ./new/${name}/test.nix;
}
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

No branches or pull requests

1 participant