I'm trying to recognise the following structures:
(1)
IF VARIABLE(THINGY) != "Q" THEN
Blah
ENDIF
(2)
IF VARIABLE(WHATEVER) != "X" THEN DoSomething
I can detect(1) with
<lexem Priority="5" BeginBlock="If" EndBlock="endif" Type="ConditionBlock" Format="ConditionBlock" IsComplex="true" IsCollapsable="true" CollapseName="If...Endif"
/>
However, I can't see a way of detecting (2) without (1) being picked up instead (and any EndIf in the document being used as an endblock). I would like to have (2) chosen when it detects printable text after the THEN statement.
I also can't see any way to ensure the IF statement is the first statement on the line, as using '^' to indicate the start of the line is always matched as true, and prefixing the rule with [] or [\r] fails to match.
Some more doco or examples on the lexems would be nice, as it's pretty tricky if you're developing syntaxes for your own language...
Cheers,
Jason