1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 02:11:15 +02:00

parser.y: move attr doc setting into addAttr

This commit is contained in:
Ryan Hendrickson 2024-07-20 12:04:25 -04:00
parent 429a197d24
commit b0a8430e85
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 ';'