I am defining a DyanmicSyntaxLanguage. I've got the bracket highlightting to work except that nested brackets aren't getting highlighted correctly. For every opening bracket the first closing bracket gets highlighted.
For example:
((test) asdf )
How can I get the parser to match these correctly?
<?xml version="1.0"?> <SyntaxLanguages> <!-- Script Language Definition --> <SyntaxLanguage Key="Script" LanguageDefinitionVersion="4.0" Secure="False" WordStandaloneCharacters="!"'(),./:;<>?[\]{}←" xmlns="http://ActiproSoftware/SyntaxEditor/4.0/LanguageDefinition"> <!-- String Properties --> <Properties /> <!-- Triggers --> <Triggers /> <!-- Highlighting Styles --> <Styles> <Style Key="DefaultStyle" Name="Text" ForeColor="#000000" BorderColor="#000000" StrikeOutColor="#000000" UnderlineColor="#000000" /> <Style Key="CommentStyleKey" Name="" ForeColor="#006400" BorderColor="#006400" StrikeOutColor="#006400" UnderlineColor="#006400" /> <Style Key="CommentStyleKeyDefault" Name="" ForeColor="#006400" BorderColor="#006400" StrikeOutColor="#006400" UnderlineColor="#006400" /> <Style Key="StringStyleKey" Name="" ForeColor="#0000FF" BorderColor="#0000FF" StrikeOutColor="#0000FF" UnderlineColor="#0000FF" /> <Style Key="StringStyleKeyDefault" Name="" ForeColor="#0000FF" BorderColor="#0000FF" StrikeOutColor="#0000FF" UnderlineColor="#0000FF" /> <Style Key="BracketStyleKey" Name="" /> <Style Key="BracketStyleKeyDefault" Name="" /> <Style Key="AssignStyleKey" Name="" ForeColor="#FF0000" BorderColor="#FF0000" StrikeOutColor="#FF0000" UnderlineColor="#FF0000" /> <Style Key="AssignStyleKeyDefault" Name="" ForeColor="#FF0000" BorderColor="#FF0000" StrikeOutColor="#FF0000" UnderlineColor="#FF0000" /> </Styles> <!-- Macros --> <Macros /> <!-- States --> <States> <!-- DefaultState State --> <State Key="DefaultState" TokenKey="DefaultToken" Style="DefaultStyle"> <!-- Child States --> <ChildStates> <ChildState Key="Comment" /> <ChildState Key="String" /> <ChildState Key="Bracket" /> </ChildStates> </State> <!-- Comment State --> <State Key="Comment" TokenKey="CommentDefaultToken" Style="CommentStyleKeyDefault"> <!-- Scopes --> <Scopes> <Scope BracketHighlight="True"> <RegexPatternGroup Type="StartScope" TokenKey="Comment" Style="CommentStyleKey" PatternValue="⍝" EndBracket="" /> <RegexPatternGroup Type="EndScope" TokenKey="Comment" Style="CommentStyleKey" PatternValue="{LineTerminatorMacro}" StartBracket="" /> </Scope> </Scopes> </State> <!-- String State --> <State Key="String" TokenKey="StringDefaultToken" Style="StringStyleKeyDefault"> <!-- Scopes --> <Scopes> <Scope BracketHighlight="True"> <ExplicitPatternGroup Type="StartScope" TokenKey="String" Style="StringStyleKey" PatternValue="'" EndBracket="" /> <ExplicitPatternGroup Type="EndScope" TokenKey="String" Style="StringStyleKey" PatternValue="'" StartBracket="" /> </Scope> </Scopes> </State> <!-- Bracket State --> <State Key="Bracket" TokenKey="BracketDefaultToken" Style="BracketStyleKeyDefault"> <!-- Scopes --> <Scopes> <Scope BracketHighlight="True"> <ExplicitPatternGroup Type="StartScope" TokenKey="Bracket" Style="BracketStyleKey" PatternValue="(" EndBracket="" /> <ExplicitPatternGroup Type="EndScope" TokenKey="Bracket" Style="BracketStyleKey" PatternValue=")" StartBracket="" /> </Scope> </Scopes> </State> <!-- Assign State --> <State Key="Assign" TokenKey="AssignDefaultToken" Style="AssignStyleKeyDefault"> <!-- Scopes --> <Scopes> <Scope BracketHighlight="True"> <ExplicitPatternGroup Type="StartScope" TokenKey="Assign" Style="AssignStyleKey" PatternValue="←" EndBracket="" /> <ExplicitPatternGroup Type="EndScope" TokenKey="Assign" Style="AssignStyleKey" PatternValue="←" StartBracket="" /> </Scope> </Scopes> </State> </States> <!-- Example Text --> <ExampleText><![CDATA[RS ← RecordSet.New '']]></ExampleText> </SyntaxLanguage> </SyntaxLanguages>
[Modified 12 years ago]