1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-24 11:19:35 +01:00

Merge pull request #5986 from NixOS/backport-5984-to-2.6-maintenance

[Backport 2.6-maintenance] Fix parsing of variable names that are a suffix of '__curPos'
This commit is contained in:
Eelco Dolstra 2022-01-25 11:59:12 +01:00 committed by GitHub
commit 45ed4e6178
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View file

@ -405,7 +405,7 @@ expr_select
expr_simple
: ID {
std::string_view s = "__curPos";
if (strncmp($1.p, s.data(), s.size()) == 0)
if ($1.l == s.size() && strncmp($1.p, s.data(), s.size()) == 0)
$$ = new ExprPos(CUR_POS);
else
$$ = new ExprVar(CUR_POS, data->symbols.create($1));

View file

@ -0,0 +1 @@
3

View file

@ -0,0 +1,2 @@
((__curPosFoo: __curPosFoo) 1) + ((__curPosBar: __curPosBar) 2)