How do I implement double quotes to signify StringState?

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Krispy
Avatar
Hi guys. The following xml code demonstrates how to toggle StringState using a single quotation mark.
<!-- Strings -->
    <State Key="StringState" TokenKey="StringDefaultToken" Style="StringDefaultStyle">
      <!-- Scopes -->
      <Scopes>
        <Scope>
          <ExplicitPatternGroup Type="StartScope" TokenKey="StringStartToken" Style="StringDelimiterStyle" PatternValue="'" />
          <ExplicitPatternGroup Type="EndScope" TokenKey="StringEndToken" Style="StringDelimiterStyle" PatternValue="'" />
        </Scope>
      </Scopes>
      <!-- Patterns Groups -->
      <PatternGroups>
        <RegexPatternGroup TokenKey="StringDefaultToken" PatternValue="[^']+" />
      </PatternGroups>
    </State>
How would I alter this code to implement a double quotation mark as toggling the StringState?

I have tried the following, but it does not appear to like the escape '\' character.
<RegexPatternGroup TokenKey="StringDefaultToken" PatternValue="[^\"]+" />
Thanks in advance.

Comments (1)

Posted 12 years ago by Krispy
Avatar
It's okay - I found what I was looking for.

    <State Key="StringState" TokenKey="StringDefaultToken" Style="StringDefaultStyle">
      <!-- Scopes -->
      <Scopes>
        <Scope>
          <ExplicitPatternGroup Type="StartScope" TokenKey="StringStartToken" Style="StringDelimiterStyle" PatternValue="&quot;" />
          <ExplicitPatternGroup Type="EndScope" TokenKey="StringEndToken" Style="StringDelimiterStyle" PatternValue="&quot;" />
        </Scope>
      </Scopes>
      <!-- Patterns Groups -->
      <PatternGroups>
        <RegexPatternGroup TokenKey="StringEscapedCharacterToken" PatternValue="\\." />
        <RegexPatternGroup TokenKey="StringWhitespaceToken" PatternValue="{WhitespaceMacro}+" IsWhitespace="True" />
        <RegexPatternGroup TokenKey="StringWordToken" PatternValue="\w+" />
        <RegexPatternGroup TokenKey="StringDefaultToken" PatternValue="[^\&quot;]" />
      </PatternGroups>
    </State>
I should have been using '\&quot;'

[Modified at 03/27/2008 07:23 AM]
The latest build of this product (v2018.1 build 0341) was released 10 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.