<div>
I'm trying to work an issue out...
</div><div><br></div><div>It's a smalltalk grammar for redline smalltalk.</div><div><br></div><div>method start with either + or - to indicate class or instance</div><div><br></div><div>then all of the following are examples of valid smalltalk methods</div><div><br></div><div>string</div><div>at:</div><div>at:put:</div><div><br></div><div>textually those would be something like</div><div><br></div><div>- string</div><div><br></div><div>- at: anIndex</div><div><br></div><div>- at: anIndex put: aValue</div><div><br></div><div>The current rule I have to match that is:</div><div><br></div><div><div><span class="Apple-tab-span" style="white-space:pre"> </span>method_definition = {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>begin = '^-|\+\s';</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>end = '$';</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>match = '((\w+:?)(\s*\w+)?)';</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>2 = { name = 'entity.name.function.instance.smalltalk'; };</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>3 = { name = 'variable.parameter.method.smalltalk'; };</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>include = '#language_elements'; },</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><br></div><div>The problem really are ones like</div><div><br></div><div>at:put:</div><div><br></div><div>Keyword methods with more than a single keyword.</div><div><br></div><div>Textmate sees it not as </div><div><br></div><div>at:put:</div><div><br></div><div>But at: & put:</div><div><br></div><div>Highlighting works great but the naming isn't correct.</div><div><br></div><div>Can I mark</div><div><br></div><div>at: anIndex put: aValue</div><div><br></div><div>as the function</div><div>then further say anIndex and aValue are method parameters?</div><div><br></div><div>then transforming into just at:put:</div><div><br></div><div>If that is a reasonable approach. What is the best way to match the variable number of keywords as a single run?</div><div>I can get the one at a time in the above approach but I can't figure out a way to match all at once and still mark the individual method parameters.</div><div><br></div>
<div></div>
<p style="color: #A0A0A8;">On Wednesday, November 30, 2011 at 4:02 AM, Martin Kühl wrote:</p>
<blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
<span><div><div><div>On Wed, Nov 30, 2011 at 04:38, Sean T Allen <<a href="mailto:sean@monkeysnatchbanana.com">sean@monkeysnatchbanana.com</a>> wrote:</div><blockquote type="cite"><div><div>What are the rules for what items from a language grammar appear in the</div><div>symbol list?</div></div></blockquote><div><br></div><div>I think the `<a href="http://entity.name">entity.name</a>` scopes are included by default.</div><div><br></div><div>If you're defining a grammar for a class-based language (it sounds</div><div>like you are) you might want to customize their appearance anyway, as</div><div>described in [1]. (The Java bundle is a good example.)</div><div><br></div><div>Cheers,</div><div>Martin</div><div><br></div><div><br></div><div>[1]: <a href="http://manual.macromates.com/en/navigation_overview#customizing_the_list">http://manual.macromates.com/en/navigation_overview#customizing_the_list</a></div><div><br></div><div>_______________________________________________</div><div>textmate mailing list</div><div><a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a></div><div><a href="http://lists.macromates.com/listinfo/textmate">http://lists.macromates.com/listinfo/textmate</a></div></div></div></span>
</blockquote>
<div>
<br>
</div>