Posted 20 years ago
by painetraine
I have the following line in my document:
begin -- comment
And I have the following states:
<State Key="CommentState" Token="CommentDefaultToken" Style="CommentDefaultStyle">
<!-- Scopes -->
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="CommentStartToken" Style="CommentDelimiterStyle" PatternValue="--" />
<RegexPatternGroup Type="EndScope" Token="CommentStringEndToken" Style="CommentDelimiterStyle" PatternValue="{LineTerminatorMacro}" />
</Scope>
</Scopes>
<!-- Patterns Groups -->
<PatternGroups>
<RegexPatternGroup Token="CommentDefaultToken" PatternValue="{NonLineTerminatorMacro}+" />
</PatternGroups>
</State>
<State Key="BeginBlockState" Token="BeginBlockToken" Style="ReservedWordStyle">
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="BeginStartToken" Style="ReservedWordStyle" PatternValue="Begin" LookAhead="{NonWordMacro}" />
<RegexPatternGroup Type="EndScope" Token="BeginEndToken" Style="DefaultStyle" PatternValue="[ ]|{LineTerminatorMacro}" />
</Scope>
</Scopes>
<PatternGroups>
<RegexPatternGroup Token="BeginBlockToken" PatternValue="\s+" />
</PatternGroups>
<ChildStates>
<ChildState Key="CommentState"/>
</ChildStates>
</State>
However, I want to end the Begin statement immediately after the begin but I cannot get it to end and the lineterminatormacro applies to the comment so the begin lineterminatormacro doesn't kick in for the begin until the next line so I get some weird parsing behavior since anything on the next line after the comment gets treated as "BeginBlockToken". Can someone tell me how I can get the parsing engine to end immediately after the begin so that it won't skip over the next line before it reaches the BeginEndToken.
Thanks
begin -- comment
And I have the following states:
<State Key="CommentState" Token="CommentDefaultToken" Style="CommentDefaultStyle">
<!-- Scopes -->
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="CommentStartToken" Style="CommentDelimiterStyle" PatternValue="--" />
<RegexPatternGroup Type="EndScope" Token="CommentStringEndToken" Style="CommentDelimiterStyle" PatternValue="{LineTerminatorMacro}" />
</Scope>
</Scopes>
<!-- Patterns Groups -->
<PatternGroups>
<RegexPatternGroup Token="CommentDefaultToken" PatternValue="{NonLineTerminatorMacro}+" />
</PatternGroups>
</State>
<State Key="BeginBlockState" Token="BeginBlockToken" Style="ReservedWordStyle">
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="BeginStartToken" Style="ReservedWordStyle" PatternValue="Begin" LookAhead="{NonWordMacro}" />
<RegexPatternGroup Type="EndScope" Token="BeginEndToken" Style="DefaultStyle" PatternValue="[ ]|{LineTerminatorMacro}" />
</Scope>
</Scopes>
<PatternGroups>
<RegexPatternGroup Token="BeginBlockToken" PatternValue="\s+" />
</PatternGroups>
<ChildStates>
<ChildState Key="CommentState"/>
</ChildStates>
</State>
However, I want to end the Begin statement immediately after the begin but I cannot get it to end and the lineterminatormacro applies to the comment so the begin lineterminatormacro doesn't kick in for the begin until the next line so I get some weird parsing behavior since anything on the next line after the comment gets treated as "BeginBlockToken". Can someone tell me how I can get the parsing engine to end immediately after the begin so that it won't skip over the next line before it reaches the BeginEndToken.
Thanks