diff --git a/nixd/include/nixd/Syntax/Nodes.inc b/nixd/include/nixd/Syntax/Nodes.inc index 7b19b14ba..28876f114 100644 --- a/nixd/include/nixd/Syntax/Nodes.inc +++ b/nixd/include/nixd/Syntax/Nodes.inc @@ -22,7 +22,7 @@ NODE(With, { Node *Attrs; Node *Body; }) -NODE(Binds, {}) +NODE(Binds, { std::vector Attributes; }) NODE(Let, { Node *Binds; Node *Body; diff --git a/nixd/lib/Syntax/Parser/Parser.y b/nixd/lib/Syntax/Parser/Parser.y index affbf0722..1155a8bd7 100644 --- a/nixd/lib/Syntax/Parser/Parser.y +++ b/nixd/lib/Syntax/Parser/Parser.y @@ -379,9 +379,15 @@ identifier binds - : binds attribute - | binds inherited_attribute - | + : binds attribute { + $$->Attributes.emplace_back($2); + $$->Range = mkRange(yylloc, *Data); + } + | binds inherited_attribute { + $$->Attributes.emplace_back($2); + $$->Range = mkRange(yylloc, *Data); + } + | { $$ = decorateNode(new Binds, yylloc, *Data); } // Nixd extension inherited_attribute