Sunday, 2 June 2013

Gedit gktsourceview3.0 rules - multiple optional suffixes

Gedit gktsourceview3.0 rules - multiple optional suffixes

I'm trying to write a syntax highlighter rule for arm assembly to use in gedit. In arm, every command has some optional suffixes which make it execute conditionally. So obviously I want the command itself to be highlighted, but also have it highlighted if it has a suffix. So, I created a keyword list that looks like this:
<context id="keywords" style-ref="keyword">
    <suffix>(ne)?|(cs)?|(hs)?|(cc)?|(lo)?|(mi)?|(pl)?|(vs)?|(vc)?|(hi)?|(ls)?|(ge)?|(lt)?|(gt)?|(le)?|(al)?</suffix>
    <keyword>add</keyword>
    ....keywords....
</context>
All the listed keywords get highlighted. However only [ANYKEYWORDHERE]ne [ANYKEYWORDHERE]cs get highlighted. It looks like it's only paying attention to the first 2 suffixes. What am I doing wrong?

No comments:

Post a Comment