[TxMt] Confusion over captured group numbering
Allan Odgaard
throw-away-1 at macromates.com
Tue Apr 10 13:59:35 UTC 2007
On 10. Apr 2007, at 12:00, Hector Chu wrote:
> In the begin pattern for meta.preprocessor.macro.c (see
> http://macromates.com/svn/Bundles/trunk/Bundles/C.tmbundle/Syntaxes/
> C.plist)
> I count the following groups:
>
> 1: (define)
> 2: ((?<id>[a-zA-Z_][a-zA-Z0-9_]*))
> 3: (?<id>[a-zA-Z_][a-zA-Z0-9_]*)
> 4: (\()
> 5: ( \s* \g<id> \s* (, \s* \g<id> \s*)* (?:\.\.\.)? )
> 6: (, \s* \g<id> \s*)
> 7: (\))
>
> This doesn't seem to match up with the order in beginCaptures, where 6
> is given the scope punctuation.definition.parameters.c. Shouldn't it
> be 7 that is given that scope instead?
Joachim just did a fix for this, but I think it actually exposes a TM
bug in assigning scopes to captures.
I’ll devote more time to looking into it later.
More information about the textmate
mailing list