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:
parent
429a197d24
commit
b0a8430e85
2 changed files with 10 additions and 14 deletions
|
@ -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 ';'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue