1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-25 03:39:36 +01:00

parser.y: move attr doc setting into addAttr

(cherry picked from commit b0a8430e85)
This commit is contained in:
Ryan Hendrickson 2024-07-20 12:04:25 -04:00 committed by Robert Hensing
parent cd169f14f0
commit 6ae5aa7fa0
2 changed files with 10 additions and 14 deletions

View file

@ -366,18 +366,7 @@ ind_string_parts
binds
: binds[accum] attrpath '=' expr ';' {
$$ = $accum;
auto pos = state->at(@attrpath);
auto exprPos = state->at(@expr);
{
auto it = state->lexerState.positionToDocComment.find(pos);
if (it != state->lexerState.positionToDocComment.end()) {
$expr->setDocComment(it->second);
state->lexerState.positionToDocComment.emplace(exprPos, it->second);
}
}
state->addAttr($$, std::move(*$attrpath), $expr, pos);
state->addAttr($$, std::move(*$attrpath), @attrpath, $expr, @expr);
delete $attrpath;
}
| binds[accum] INHERIT attrs ';'