problem with parsing file

SyntaxEditor for Windows Forms Forum

Posted 20 years ago by painetraine
Avatar
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">
<Scopes>
<Scope>
<RegexPatternGroup Type="StartScope" Token="SystemProcStartToken" Style="FunctionStyle" PatternValue="[Ss][Pp][_]{1}\w*" LookAhead="{NonWordMacro}"/>
<RegexPatternGroup Type="EndScope" Token="SystemProcEndToken" Style="DefaultStyle" PatternValue="\w|\s"/>
</Scope>
</Scopes>

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

</State>

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 20 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Why don't you just have a single pattern in the default state that looks for something like:
[Ss][Pp][_](\w)+

Is there a reason you have it in a state?


Actipro Software Support

The latest build of this product (v24.1.1) 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.