We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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-repl> { ''x'' = 0; }.x error: syntax error, unexpected IND_STRING_OPEN, at (string):1:3
hnix> { ''x'' = 0; }.x 0
Is this a bug?
The text was updated successfully, but these errors were encountered:
This is the relevant type:
hnix/src/Nix/Expr/Types.hs
Lines 268 to 271 in 704323e
And here's some parser output:
> parseNixText "{ ''x'' = 0; }" Success (Fix (NSet NNonRecursive [NamedVar (DynamicKey (Plain (Indented 0 [Plain "x"])) :| []) (Fix (NConstant (NInt 0))) (SourcePos {sourceName = "<string>", sourceLine = Pos 1, sourceColumn = Pos 3})]))
I think the problem is that by using (NString r) for the string type in DynamicKey's Antiquoted field, we also allow Indented strings.
(NString r)
DynamicKey
Antiquoted
Indented
I wonder whether a solution would be to split NString:
NString
newtype DoubleQuoted r = DoubleQuoted [Antiquoted Text r] data Indented r = Indented Int [Antiquoted Text r] data NString r = DoubleQuoted' (DoubleQuoted r) | Indented' (Indented r)
Then we could define DynamicKey like this:
data NKeyName r = DynamicKey !(Antiquoted (DoubleQuoted r) r) | StaticKey !VarName
Sorry, something went wrong.
No branches or pull requests
Is this a bug?
The text was updated successfully, but these errors were encountered: