PreviousNextTracker indexSee it online !

(24/207) 1572834 - Edit modes: allow RULES set to get handled after KEYWORDS

Currently, KEYWORDS in a edit mode get handled after
all other rules (including imported ones of course).

I'd like to add a AFTER_KEYWORDS attribute to RULES,
which would handle the rules therein after keywords
have been processed.

From looking at the code, I'd say to have two lists in
ParserRuleSet, one for "normal" rules and another for
the rules after keywords.

Then, when resolving imports, ruleset property gets
handled accordingly.

The main problem here seems to be the
TokenMarker::markTokens() method, because keywords get
handled there at the end, outside of the main loop and
I don't think it's that trivial.

The use case for this is:
a list of SPAN_REQEXP (regular expressions) to mark
functions. Because of HASH_CHAR you end up with about
26 rules, but it allows to match also "foo ($bar)"
(with whitespace after the function name), in contrast
to MARK_PREVIOUS. Additionally, the list of arguments
to the function can be delegated to a special RULES set.
It works well, except it will match all keywords also,
e.g. like "empty( $foo )" in PHP. "empty" is a keyword,
but gets never handled as one with the above set of
regular expressions.

Submitted blueyed - 2006-10-07 - 18:15:15z Assigned nobody
Priority 5 Category core
Status Open Group None
Resolution None Visibility No