refactor(parser): make REDUCE macro non-variadic

This commit is contained in:
ObserverOfTime 2024-04-11 20:35:09 +03:00
parent 895c7680e7
commit 818cd8c291
No known key found for this signature in database
GPG key ID: 8A2DEA1DBAEBCA9E
2 changed files with 10 additions and 14 deletions

View file

@ -1299,16 +1299,9 @@ impl Generator {
} => {
add!(
self,
"REDUCE(.symbol = {}, .child_count = {child_count}",
"REDUCE({}, {child_count}, {dynamic_precedence}, {production_id})",
self.symbol_ids[&symbol]
);
if dynamic_precedence != 0 {
add!(self, ", .dynamic_precedence = {dynamic_precedence}");
}
if production_id != 0 {
add!(self, ", .production_id = {production_id}");
}
add!(self, ")");
}
}
add!(self, ",");