problem with parsing file

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by painetraine
I am trying to create a particular state that maps tp a SQL Server system stored procedure, ie. sp_<...>?

I have the following defined for a state,

<State Key="SystemProcState" Token="SystemProcDefaultToken" Style="FunctionStyle">
<RegexPatternGroup Type="StartScope" Token="SystemProcStartToken" Style="FunctionStyle" PatternValue="[Ss][Pp][_]{1}\w*" LookAhead="{NonWordMacro}"/>
<RegexPatternGroup Type="EndScope" Token="SystemProcEndToken" Style="DefaultStyle" PatternValue="\w|\s"/>

<RegexPatternGroup Token="SystemProcDefaultToken" PatternValue="\s+" />


However, when I try to use this state, if doesn't end until the 2nd non-space character, so for example,

sp_test 'user'

The above would format "sp_test '" as the system proc state and then user' as non-sysproctstae which causes issues because then the ' after user is treated as the start of a string.

How can I change my definition to work so that this will work and only highlight the sp_<...> name and not the space and next character afterewards?

Thanks in advamce

Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Why don't you just have a single pattern in the default state that looks for something like:

Is there a reason you have it in a state?

Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.