Hi,
I am trying to add the following rule to process Python
raw strings.
<block start="/(u|U)?(r|R)("|')/" end="/\y3/"
region00="def:PairStart" region10="def:PairEnd" scheme="RawString" region="pyString" inner-region="yes" content-priority="low" />
I use
inner-region to exclude surrounded quotes from processing. This works good for starting quote, but the starting quote is not highlighted as pyString anymore. So, the first question:
Q1: Is it possible to assign additional color property in addition to semantic def:PairStart tag of region00 element? Something like region00="def:PairStart pyString" and make sure that specifying two conflicting color tags is an error. Documentation doesn't mention that this is possible.
Excluding quotes from processing by inner scheme doesn't work well for ending quote, because block end rule is matched together with RawString rules, so I need to be careful not to match end rule inside of string. Therefore I set content-priority="low" which doesn't work - ending quote is still highlighted as error. The inner-region scheme definition that does this is below.
<scheme name="RawString">
<!-- first matched rule wins (just a reminder) -->
<regexp match="/[^\\]$/" region="def:Error" />
</scheme>
The ending quote is still matched by def:Error - I wish I could give a link to
http://jsfiddle.net/ so that you can test yourself, but Colorer is not ported to JavaScript (a Native Cliend port is still possible, though).
Q2: Why content-priority="low" didn't work for this case?
And also because RawString is an external schema to <block> element, it can not know if I am processing single quote string of double quote. Therefore:
Q3: Is it possible to access elements matched in parent <block> context from referenced schema? For example, matched quote element in example above is accessible by \y3 backreference in <block>, but not in schema.