summaryrefslogtreecommitdiffstats
path: root/src/parse.y
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-04-18 20:06:23 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-04-18 20:06:23 +0200
commitba8f9797cb4f0c06d6a9ff11b51470a15eb81ee0 (patch)
tree5bb0d74725bf6e5651af913a9cea6a4c41cf5b80 /src/parse.y
parent30c2141182f4eed1d3549603a7aa92c57b35d129 (diff)
downloadsolar-master.tar
solar-master.zip
Allow specifying actions for groups terminalsHEADmaster
Also, more refactoring.
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/parse.y b/src/parse.y
index db959df..0b8b992 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -69,14 +69,12 @@ directive |= "%extra_arg" BLOCK(type) csymbol(name) {
}
directive |= SYMBOL(lhs) "|=" rhs(rhs) action(action) {
- grammar->add_rule({item_t(*lhs, rhs->first), rhs->second, *action});
+ grammar->add_rule(item_t(*lhs, rhs->first), rhs->second, *action);
}
-directive |= SYMBOL(lhs) "|=" '(' CHAR(c1) "..." CHAR(c2) ')' ';' {
- vars_t vars(1);
-
+directive |= SYMBOL(lhs) "|=" '(' CHAR(c1) "..." CHAR(c2) ')' action(action) {
for (unsigned int c = c1; c <= c2; c++)
- grammar->add_rule({item_t(*lhs, {symbol_t::make_char(c)}), vars, std::string()});
+ grammar->add_rule(item_t(*lhs, {symbol_t::make_char(c)}), vars_t(1), *action);
}