<font color="#000066"><font><font face="comic sans ms,sans-serif"><br></font></font></font><div><font color="#000066"><font><font face="comic sans ms,sans-serif">I have the following language grammar defined for Java Properties files. This grammar works as expected in TM-1, however, there are two</font></font></font></div>
<div><font color="#000066" face="'comic sans ms', sans-serif">separate problems when using this grammar with TM-2.</font></div><div><font color="#000066" face="'comic sans ms', sans-serif"><br></font></div>
<div><font color="#000066" face="'comic sans ms', sans-serif">1. The end capture for a </font><font color="#000066" face="'courier new', monospace">'Property Definition'</font><font color="#000066" face="'comic sans ms', sans-serif"> does not properly skip a newline preceded by a backslash and thus does not recognize continued lines.</font></div>
<div><font color="#000066" face="'comic sans ms', sans-serif">2. The pattern </font><font color="#000066" face="'courier new', monospace">'\{\d+\}'</font><font color="#000066" face="'comic sans ms', sans-serif"> is not being recognized to set the '</font><span style="color:rgb(0,0,102);font-family:'courier new',monospace">entity.name.variable.java-props' </span><span style="color:rgb(0,0,102)"><font face="'comic sans ms', sans-serif">scope. This pattern does match</font></span></div>
<div><font color="#000066" face="'comic sans ms', sans-serif">properly in a simple grammar where it is the only pattern however. (This pattern is not part of java properties but I'm using the property files</font></div>
<div><font color="#000066" face="'comic sans ms', sans-serif">to store strings that will be used with the java.text formatters.)</font></div><div><font color="#000066" face="'comic sans ms', sans-serif"><br>
</font></div><div><font color="#000066" face="'comic sans ms', sans-serif">Perhaps there is a better way to describe this grammar, I'm no expert. But since it does work correctly in TM-1 I wanted to report it as potential defects in TM-2.</font></div>
<div><font color="#000066" face="'comic sans ms', sans-serif"><br></font></div><div><font color="#000066" face="'comic sans ms', sans-serif">Thanks,</font></div><div><font color="#000066" face="'comic sans ms', sans-serif">Curt</font></div>
<div><font color="#000066" face="'comic sans ms', sans-serif"><br></font></div><div><font color="#000066" face="'courier new', monospace"><div>{<span class="Apple-tab-span" style="white-space:pre"> </span>scopeName = 'source.java-props';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fileTypes = ( 'properties' );</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>patterns = (</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'comment.line.number-sign.java-props';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '^\s*([#!])(.+)?$\n?';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>captures = { 1 = { name = 'punctuation.definition.comment.java-props'; }; };</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>comment = 'Empty Property Definition';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '^\s*((?:\\:|\\=|[^:=\s])+)\s*([:=])\s*$';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>captures = {</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>1 = { name = 'keyword.other.java-props'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>2 = { name = 'punctuation.separator.key-value.java-props'; };</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>};</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>comment = 'Property Definition';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>begin = '^\s*((?:\\:|\\=|[^:=\s])+)\s*([:=])\s*';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>end = '(?<!\\{1})$\n?';</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 = 'keyword.other.java-props'; };</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>2 = { name = 'punctuation.separator.key-value.java-props'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>};</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>patterns = (</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'entity.name.variable.java-props';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '\{\d+\}';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>comment = 'Leading space on a continued line is ignored';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '^\s*';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'punctuation.separator.continuation.java-props';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '(\\)(?=$\n)';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'constant.character.escape.java-props';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '\\(?:[\\nt\"'']|u[0-9A-Fa-f]{4})';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'invalid.illegal.character.escape.java-props';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '\\.';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'string.java-props';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '.';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>);</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>comment = 'Ignore blank lines';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '^\s*$';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>{<span class="Apple-tab-span" style="white-space:pre"> </span>name = 'invalid.illegal.java-props';</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>comment = 'Anything else is illegal';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>match = '.*';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>},</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>);</div><div>}</div></font></div>