PreviousNextTracker indexSee it online !

(17/211) 2894 - DELEGATE does not work, if prev. mode file not parsed yet

Given two mode files (css.xml and html.xml) like below and opening a .css file, you'll get an "delegate-invalid" error: "Invalid delegate: css::PROPERTIES".

The problem is that the css::PROPERTIES is not parsed yet, when the IMPORT of html::TAGS from css::MAIN uses it in the DELEGATE.

You can fix this in the css.xml file, by first defining "PROPERTIES" and then the MAIN rules, but it makes no sense, to only handle future rulesets by the "stupid hack to handle referencing a rule set that is defined later\!" in XModeHandler.

The attached patch removes this restriction and seems to cause no trouble as far as I can see.


CSS.XML:
<?xml version="1.0"?>
<\!DOCTYPE MODE SYSTEM "xmode.dtd">
<MODE>
<RULES>
<IMPORT DELEGATE="html::TAGS" />
</RULES>

<\!-- we delegate here back from html::TAGS\! -->
<RULES SET="PROPERTIES">
</RULES>
</MODE>


HTML.XML:
<?xml version="1.0"?>
<\!DOCTYPE MODE SYSTEM "xmode.dtd">
<MODE>
<RULES>
</RULES>

<RULES SET="TAGS" DEFAULT="MARKUP" ESCAPE="\">
<SEQ DELEGATE="css::PROPERTIES">foo</SEQ>

<KEYWORDS>
<MARKUP>body</MARKUP>
</KEYWORDS>
</RULES>
</MODE>


foo.css:
body {}

Submitted blueyed - 2007-06-23 19:20:36 Assigned
Priority 5 Labels text area and syntax packages
Status open Group None
Resolution None

Comments

2007-06-23 19:20:36
blueyed

Patch against svn trunk

jedit-fix-invalid-delegate.diff (861B)

2007-06-23 19:21:20
blueyed

- **labels**: --> text area and syntax packages