<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi all,<div><br></div><div>when using TextMate2 with (modern) Fortran I found that the implementation of derived types does not support the access attributes. For example,</div><div><br></div><div>type node</div><div> integer :: i</div><div>end type node</div><div><br></div><div>looks nice, while inserting the "public" or "private" attributes as in</div><div><br></div><div>type, public :: node</div><div> integer :: i</div><div>end type node</div><div><br></div><div>does not produce a consistent coloring (see also the attached screenshot1.png).</div><div><br></div><div>In an first attempt to resolve the problem, I changed the the corresponding entry in the Fortran-Modern Grammar from</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'meta.type-definition.fortran.modern';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>comment = 'Type definition';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>begin = '(?x:<span class="Apple-tab-span" style="white-space:pre"> </span># extended mode</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>^\s*<span class="Apple-tab-span" style="white-space:pre"> </span> # begining of line and some space</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(?i:(type))<span class="Apple-tab-span" style="white-space:pre"> </span> # 1: word type</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>\s+<span class="Apple-tab-span" style="white-space:pre"> </span># some space</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>([a-zA-Z_][a-zA-Z0-9_]*)<span class="Apple-tab-span" style="white-space:pre"> </span># 2: type name</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>)';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>end = '(?x:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>((?i:end))<span class="Apple-tab-span" style="white-space:pre"> </span># 1: the word end</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>\s*<span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span># possibly some space</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(?i:(type))? <span class="Apple-tab-span" style="white-space:pre"> </span># 2: possibly the word type</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\s+[A-Za-z_][A-Za-z0-9_]*)?<span class="Apple-tab-span" style="white-space:pre"> </span># 3: possibly the name</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>)';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>beginCaptures = {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1 = { name = 'storage.type.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>2 = { name = 'entity.name.type.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>};</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>endCaptures = {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1 = { name = 'keyword.other.fortran'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>2 = { name = 'storage.type.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>3 = { name = 'entity.name.type.end.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>};</div></div><div><br></div><div>to</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'meta.type-definition.fortran.modern';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>comment = 'Type definition';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>begin = '(?x:<span class="Apple-tab-span" style="white-space:pre"> </span># extended mode</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>^\s*<span class="Apple-tab-span" style="white-space:pre"> </span> # begining of line and some space</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(?i:(type))<span class="Apple-tab-span" style="white-space:pre"> </span> # 1: word type</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span><b><font color="#ff2600">(,\*(?i:(public|private)?)) # 2: optional access attribute</font></b></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>\s+<span class="Apple-tab-span" style="white-space:pre"> </span># some space</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>([a-zA-Z_][a-zA-Z0-9_]*)<span class="Apple-tab-span" style="white-space:pre"> </span># 3: type name</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>)';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>end = '(?x:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>((?i:end))<span class="Apple-tab-span" style="white-space:pre"> </span># 1: the word end</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>\s*<span class="Apple-tab-span" style="white-space:pre"> </span> <span class="Apple-tab-span" style="white-space:pre"> </span># possibly some space</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(?i:(type))? <span class="Apple-tab-span" style="white-space:pre"> </span># 2: possibly the word type</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>(\s+[A-Za-z_][A-Za-z0-9_]*)?<span class="Apple-tab-span" style="white-space:pre"> </span># 3: possibly the name</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>)';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>beginCaptures = {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1 = { name = 'storage.type.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>2 <b><font color="#ff2600">= { name = 'storage.modifier.fortran.modern'; };</font></b></div><div><b><font color="#ff2600"> <span class="Apple-tab-span" style="white-space: pre; "> </span>3</font></b> = { name = 'entity.name.type.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>};</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>endCaptures = {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>1 = { name = 'keyword.other.fortran'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>2 = { name = 'storage.type.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>3 = { name = 'entity.name.type.end.fortran.modern'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>};</div></div><div><br></div><div><br></div><div>which made things even worse (screenshot2.png). I tried several other versions, with no essential improvement.</div><div><br></div><div>Can anybody give me a hint how to resolve the problem?</div><div><br></div><div><br></div><div>Regards,</div><div>Joerg</div><div><br></div><div><img height="238" width="543" apple-width="yes" apple-height="yes" id="7385c65c-fbf7-41f7-9f5f-d7b488458807" src="cid:82D58BFD-97CC-48EC-A739-A4EAE57CB18F@localdomain"></div><div><br></div><div><img id="947f8963-fe69-426e-9dba-6929873b4f31" height="238" width="543" apple-width="yes" apple-height="yes" src="cid:D905D472-BE5F-4EA8-BAE7-309819A8AE56@localdomain"></div><div><br></div><div><br></div></body></html>