@@ -29,18 +29,23 @@ namespace ice::grammar
2929 static constexpr TokenType UCT_ActionTypeFloat1{ UCT_Base + 11 };
3030 static constexpr TokenType UCT_ActionTypeFloat2{ UCT_Base + 12 };
3131 static constexpr TokenType UCT_ActionTypeFloat3{ UCT_Base + 13 };
32- static constexpr TokenType UCT_When{ UCT_Base + 14 };
33- static constexpr TokenType UCT_WhenAnd{ UCT_Base + 15 };
34- static constexpr TokenType UCT_WhenOr{ UCT_Base + 16 };
35- static constexpr TokenType UCT_WhenPressed{ UCT_Base + 17 };
36- static constexpr TokenType UCT_WhenReleased{ UCT_Base + 18 };
37- static constexpr TokenType UCT_WhenActive{ UCT_Base + 19 };
38- static constexpr TokenType UCT_WhenInactive{ UCT_Base + 20 };
39- static constexpr TokenType UCT_WhenFlagCheckSeries{ UCT_Base + 21 };
40- static constexpr TokenType UCT_StepActivate{ UCT_Base + 22 };
41- static constexpr TokenType UCT_StepDeactivate{ UCT_Base + 23 };
42- static constexpr TokenType UCT_StepReset{ UCT_Base + 24 };
43- static constexpr TokenType UCT_Modifier{ UCT_Base + 25 };
32+ static constexpr TokenType UCT_ActionFlagOnce{ UCT_Base + 14 };
33+ static constexpr TokenType UCT_ActionFlagToggled{ UCT_Base + 15 };
34+ static constexpr TokenType UCT_ActionFlagAccumulated{ UCT_Base + 16 };
35+ static constexpr TokenType UCT_When{ UCT_Base + 17 };
36+ static constexpr TokenType UCT_WhenAnd{ UCT_Base + 18 };
37+ static constexpr TokenType UCT_WhenOr{ UCT_Base + 19 };
38+ static constexpr TokenType UCT_WhenPressed{ UCT_Base + 20 };
39+ static constexpr TokenType UCT_WhenReleased{ UCT_Base + 21 };
40+ static constexpr TokenType UCT_WhenActive{ UCT_Base + 22 };
41+ static constexpr TokenType UCT_WhenInactive{ UCT_Base + 23 };
42+ static constexpr TokenType UCT_WhenFlagCheckSeries{ UCT_Base + 24 };
43+ static constexpr TokenType UCT_StepActivate{ UCT_Base + 25 };
44+ static constexpr TokenType UCT_StepDeactivate{ UCT_Base + 26 };
45+ static constexpr TokenType UCT_StepReset{ UCT_Base + 27 };
46+ static constexpr TokenType UCT_Modifier{ UCT_Base + 28 };
47+ static constexpr TokenType UCT_ModifierOpMin{ UCT_Base + 29 };
48+ static constexpr TokenType UCT_ModifierOpMax{ UCT_Base + 30 };
4449
4550 static constexpr SyntaxRule Rule_ColonOrCommaRules[]{ // , or :
4651 SyntaxRule{ TokenType::CT_Colon },
@@ -219,13 +224,33 @@ namespace ice::grammar
219224 SyntaxRule{ UCT_WhenOr },
220225 };
221226
227+ static constexpr SyntaxRule Rule_LayerActionFlagsListRules[]{
228+ SyntaxRule{ UCT_ActionFlagOnce, &syntax::LayerAction::flag_once },
229+ SyntaxRule{ UCT_ActionFlagToggled, &syntax::LayerAction::flag_toggled },
230+ SyntaxRule{ UCT_ActionFlagAccumulated, &syntax::LayerAction::flag_accumulated },
231+ };
232+
233+ static constexpr SyntaxRule Rule_LayerActionFlagsRules[]{
234+ SyntaxRule{ grammar::TokenType::CT_Comma },
235+ SyntaxRule{ Rule_LayerActionFlagsListRules, MatchFirst }
236+ };
237+
238+ static constexpr SyntaxRule Rule_LayerActionWhenFlagsListRules[]{
239+ SyntaxRule{ UCT_WhenFlagCheckSeries, &syntax::LayerActionWhen::flag_series }
240+ };
241+
242+ static constexpr SyntaxRule Rule_LayerActionWhenFlagsRules[]{
243+ SyntaxRule{ grammar::TokenType::CT_Comma },
244+ SyntaxRule{ Rule_LayerActionWhenFlagsListRules, MatchFirst }
245+ };
246+
222247 static constexpr SyntaxRule Rule_LayerActionWhenRules[]{
223248 // Just to create the child node we need to succeed once.
224249 SyntaxRule{ [](auto const &, auto & ctx) noexcept { return arctic::ParseState::Success; } }.noadvance (),
225250 SyntaxRule{ Rule_LayerActionWhenBlockRules, MatchFirst, &syntax::LayerActionWhen::type },
226251 SyntaxRule{ Rule_LayerActionWhenTargetRules, MatchAll },
227252 SyntaxRule{ Rule_LayerActionWhenTargetActionRules, MatchAll },
228- SyntaxRule{ UCT_WhenFlagCheckSeries, &syntax::LayerActionWhen::check_series }.optional (),
253+ SyntaxRule{ Rule_LayerActionWhenFlagsRules, MatchAll }.optional (),
229254 SyntaxRule{ TokenType::ST_EndOfLine }.repeat (),
230255 SyntaxRule{ Rule_LayerActionStepRules, MatchChild<syntax::LayerActionStep> }.optional ().repeat (),
231256 };
@@ -234,8 +259,25 @@ namespace ice::grammar
234259 // Action modifier rules
235260 // //////////////////////////////////////////////////////////////
236261
262+ static constexpr SyntaxRule Rule_LayerActionModifierComponentRules[]{
263+ SyntaxRule{ TokenType::CT_Dot, &syntax::LayerActionModifier::component },
264+ SyntaxRule{ Rule_LayerActionComponentListRules, MatchFirst, &syntax::LayerActionModifier::component, arctic::SyntaxRule::store_value_extend<arctic::String> }
265+ };
266+
267+ static constexpr SyntaxRule Rule_LayerActionModifierOperationListRules[]{
268+ SyntaxRule{ TokenType::OP_Div },
269+ SyntaxRule{ TokenType::OP_Mul },
270+ SyntaxRule{ TokenType::OP_Plus },
271+ SyntaxRule{ TokenType::OP_Minus },
272+ SyntaxRule{ UCT_ModifierOpMin },
273+ SyntaxRule{ UCT_ModifierOpMax },
274+ };
275+
237276 static constexpr SyntaxRule Rule_LayerActionModifierRules[]{
238277 SyntaxRule{ UCT_Modifier },
278+ SyntaxRule{ Rule_LayerActionModifierComponentRules, MatchAll },
279+ SyntaxRule{ Rule_LayerActionModifierOperationListRules, MatchFirst, &syntax::LayerActionModifier::operation },
280+ SyntaxRule{ Rule_LayerActionWhenParamNumberTokenListRules, MatchFirst, &syntax::LayerActionModifier::param },
239281 SyntaxRule{ TokenType::ST_EndOfLine }.repeat (),
240282 };
241283
@@ -255,6 +297,7 @@ namespace ice::grammar
255297 SyntaxRule{ TokenType::CT_Symbol, &syntax::LayerAction::name },
256298 SyntaxRule{ TokenType::CT_Colon },
257299 SyntaxRule{ Rule_LayerActionTypeRules, MatchFirst, &syntax::LayerAction::type },
300+ SyntaxRule{ Rule_LayerActionFlagsRules, MatchAll }.optional (),
258301 SyntaxRule{ TokenType::ST_EndOfLine }.repeat (),
259302 SyntaxRule{ Rule_LayerActionWhenRules, MatchChild<syntax::LayerActionWhen> }.repeat ().optional (),
260303 SyntaxRule{ Rule_LayerActionModifierRules, MatchChild<syntax::LayerActionModifier> }.repeat ().optional (),
0 commit comments