Lexical Scope End Pattern Group

SyntaxEditor for WPF Forum

Posted 1 month ago by Rick - Developer, Visual Software Systems LLC
Version: 24.1.5
Avatar

I'm having an issue trying to get the End Pattern Group of a child state to match in my language's Dynamic Lexer.  The start pattern group is defined as explicit with a pattern value of 'TYPEOF' and case sensitivity of AutoCorrect.  The end pattern group is defined as Explicit with a pattern value of 'END' and a case sensitivity of AutoCorrect.  Given the following snippet:

... typeof field when value then value end ... 

I have no trouble matching the start pattern and the state transitions from the default state to the child state, but when it hits the value 'end' in the text it doesn't match and therefor doesn't transition back to the parent (default) state. The only requirement for matching is that it is preceeded by at least one space or a line terminator

If I change the end scope to use a Regex, I can get the match if the pattern is '\s*end', but I loose the ability to AutoCorrect, and the end token cannot be at the beginning of the line.  I've also tried using every combination of LookBehind and LookAhead patterns with the Patterns collection set to just 'end', but that hasn't worked.

Can you advise on why the Explicit pattern doesn't match?  Also what is the proper usage fo the LookAhead and LookBehind patterns in an End Scope?

Comments (1)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Rick,

I would expect the look-ahead/behind to function the same way for an end scope pattern group as for other usage scenarios.  What would be best is if you can email support with a new simple sample project that shows this scenario.  Then we can debug with that and see why the AutoCorrect version of END isn't matching and get back to you on why.  In the email you send, please reference this thread and exclude the bin/obj folders from the .zip you send so it doesn't get spam blocked.  Thanks!


Actipro Software Support

The latest build of this product (v25.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.