2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 04:42:11 +00:00

Make calc4b actually compile

This commit is contained in:
Henri Menke
2018-04-25 18:03:06 +12:00
parent aa2a2685e6
commit 1e0e0f29ba

View File

@@ -188,27 +188,28 @@ namespace client
x3::rule<class term, ast::program> const term("term");
x3::rule<class factor, ast::operand> const factor("factor");
BOOST_SPIRIT_DEFINE(
expression =
auto const expression_def =
term
>> *( (char_('+') >> term)
| (char_('-') >> term)
)
,
;
term =
auto const term_def =
factor
>> *( (char_('*') >> factor)
| (char_('/') >> factor)
)
,
;
factor =
auto const factor_def =
uint_
| '(' >> expression >> ')'
| (char_('-') >> factor)
| (char_('+') >> factor)
);
;
BOOST_SPIRIT_DEFINE(expression, term, factor);
auto calculator = expression;
}