Skip to content

Commit

Permalink
nixd/Syntax: action for binds
Browse files Browse the repository at this point in the history
  • Loading branch information
inclyc committed Sep 17, 2023
1 parent 7f5aa9a commit 01d2126
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion nixd/include/nixd/Syntax/Nodes.inc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ NODE(With, {
Node *Attrs;
Node *Body;
})
NODE(Binds, {})
NODE(Binds, { std::vector<Node *> Attributes; })
NODE(Let, {
Node *Binds;
Node *Body;
Expand Down
12 changes: 9 additions & 3 deletions nixd/lib/Syntax/Parser/Parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01d2126

Please sign in to comment.