[TxMt] Re: Syntax color for fortran storage modifier

Allan Odgaard mailinglist at textmate.org
Mon Aug 18 15:23:29 UTC 2014


On 15 Aug 2014, at 19:16, riki wrote:

> […] In the following code:
>
> […] I checked scope as you suggested. I got storage modifier scope 
> […] but not for allocatable.

The issue is not related to your custom theme but rather the Fortran 
grammar.

The Fortran - Modern grammar includes Fortran - Punchcard. This grammar 
has a rule for ‘meta.specification.fortran’. In this rule, a new 
context is started, and only Punchcard rules are included into that 
context, this is line 69 in the (Punchcard) grammar which is:

	patterns = ( { include = '$self'; } );

If we change this to instead include the Modern grammar then it works:

	patterns = ( { include = 'source.fortran.modern'; } );

There are other places where Punchcard includes Modern (it actually 
includes $self + Modern, but here $self is redundant since Modern 
includes Punchcard).

I do not know about this Modern vs Punchcard, it seems that if Punchcard 
is made to include Modern (as it already does) the two grammars should 
just be combined into a single one, which would make parsing more 
trapsnarent.


More information about the textmate mailing list