Consider this test_syntax.xml mode file:
"""
<?xml version="1.0"?>
<!DOCTYPE MODE SYSTEM "xmode.dtd">
<MODE>
<RULES>
<SEQ TYPE="KEYWORD1">one</SEQ>
<IMPORT DELEGATE="DELEGATE_1" />
</RULES>
<RULES SET="DELEGATE_1">
<SEQ TYPE="KEYWORD2">2two</SEQ>
<IMPORT DELEGATE="DELEGATE_2" />
</RULES>
<RULES SET="DELEGATE_2">
<SEQ TYPE="KEYWORD4">three</SEQ>
<SEQ TYPE="KEYWORD4">3three</SEQ>
</RULES>
</MODE>
"""
And this file handled by it:
"""
// Test jEdit syntax modes
one
two2two
3three
"""
The problem is, that "three" and "3three" do not get
highlighted/recognized, unless you add a rule into
the DELEGATE_1 set starting with the same
char/number, e.g. changing "2two" to "32two" would
highlight "3three" from DELEGATE_2..!
I've tried to call ParserRuleSet::resolveImports()
recursively at the beginning for the rulesets it
processes, but this can cause infinite loops.
If IMPORTS of "infinite" depth wouldn't be supported,
that would make sense, but only rules with already
existing hash/index chars get applied seems to be a
bug somewhere.
((( Use case: I want to use this for the php.xml mode
file, so that I import a list of regular expressions
for function definitions into a rule set, where the
regular KEYWORDs are defined, so that the keywords
get highlighted as supposed, but the regular
expressions (one for each hash char) are recognized
also, not overriding the highlighting of the
KEYWORDs.)))
Logged In: YES
user_id=663176
A patch to fix this is here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1572746&group_id=588&atid=300588
I don't seem to have SVN write access (at least the last
time I've tried to correct a typo), so someone should review
and apply the patch.
Logged In: YES
user_id=918212
fixed in SVN rev. 8026 will be in 4.3pre9