Its syntax was natively understood by the parser, which means it cannot be overridden (functionality that will be added later).
The parsing was done inside ScriptLoader#loadItems() instead of SyntaxParser#parseSection().
The parsing was not optimized in general.
This pull request aims to rework this syntax class:
Made the class an actual syntax class (SecConditional) that registers the section. Removed all native parsing.
Moved all section parsing to the SyntaxParser#parseSection() method, restriction checks included. Did respectively the same for effects.
Added a currentStatements field to ParserState to get all currently parsed statements inside of the enclosing section (so not outside!). This uses recursion just like the syntax restrictions.
The conditional section had some flaws:
ScriptLoader#loadItems()
instead ofSyntaxParser#parseSection()
.This pull request aims to rework this syntax class:
SecConditional
) that registers the section. Removed all native parsing.SyntaxParser#parseSection()
method, restriction checks included. Did respectively the same for effects.currentStatements
field toParserState
to get all currently parsed statements inside of the enclosing section (so not outside!). This uses recursion just like the syntax restrictions.Furthermore, I improved the testing syntax:
SecBirth
EffAssert
and removed the debug option.