<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Hello and Happy New Year!</span></span></div><div><span><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></span></div><div><span><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Does any of the TxMt gurus know why the below does not work?</span></span></div><div><span><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></span></div><div><span><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Message: 5</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px;
"><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Date: Thu, 29 Dec 2011 11:27:01 -0800 (PST)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">From: John Relosa <</span><a ymailto="mailto:john.relosa@yahoo.com" href="mailto:john.relosa@yahoo.com" style="color: rgb(35, 71, 134); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">john.relosa@yahoo.com</a><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">></span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">To: textmate
<</span><a ymailto="mailto:textmate@lists.macromates.com" href="mailto:textmate@lists.macromates.com" style="color: rgb(35, 71, 134); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">textmate@lists.macromates.com</a><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">></span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Subject: [TxMt] Re: Coloring for a function call</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Message-ID:</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size:
12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "> <</span><a ymailto="mailto:1325186821.60244.YahooMailNeo@web121902.mail.ne1.yahoo.com" href="mailto:1325186821.60244.YahooMailNeo@web121902.mail.ne1.yahoo.com" style="color: rgb(35, 71, 134); outline-width: 0px; outline-style: initial; outline-color: initial; font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">1325186821.60244.YahooMailNeo@web121902.mail.ne1.yahoo.com</a><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">></span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Content-Type: text/plain; charset="iso-8859-1"</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px;
"><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Hi Hans,</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Thanks for your reply, getting closer :-)</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">The one for call works great as it's never in the?beginning?of a line and there is always space before so this
works:</span></span></div><div><span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">{name = 'meta.call.my_LG';</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">match = '\s*(call)\s+((\w+)\w*)';</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">captures = {</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">1 = { name = 'keyword.control.my_LG'; };</span><br
style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">2 = { name = 'entity.name.call.my_LG'; };</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">};</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">},</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">I cannot make it to work
for the function though which is always in the beginning of a line with no space before it. </span></span></div><div><span><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br></span></span></div><div><span><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">I removed the \s* and replaced it with the ^ (start of line anchor) but it does NOT seem to work:</span></span></div><div><span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">{name = 'meta.function.my_LG';</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">match = '^(function)\s+((\w+)\w*)';</span><br
style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">captures = {</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">1 = { name = 'keyword.control.my_LG'; };</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">2 = { name = 'entity.name.function.my_LG'; };</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">};</span><br style="color: rgb(69, 69, 69); font-family: Arial,
Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">},</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">What am I doing wrong?</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "><span style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; ">Thanks.</span><br style="color: rgb(69, 69, 69); font-family: Arial, Helvetica, sans-serif; font-size: 12px; "></span></div><div><br></div> <div style="font-size: 12pt; font-family: 'times new roman',
'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Hans-Jörg Bibiko <bibiko@eva.mpg.de><br> <b><span style="font-weight: bold;">To:</span></b> John Relosa <john.relosa@yahoo.com>; TextMate users <textmate@lists.macromates.com> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, December 29, 2011 9:50 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [TxMt] Re: Coloring for a function call<br> </font> <br>
<br>On 29 Dec 2011, at 18:18, John Relosa wrote:<br><br>> What I was hoping to have is have the arbitrary name of the function "xyz_any_function_name" have a color red when it's defined(after the word "function") or when it's called(after the word "call".<br>> <br><br>Hi,<br><br>maybe try something like (AN EXAMPLE!):<br><br>{ name = 'meta.call.your_LG';<br> match = '^\s*(call)\s+(\S+)';<br> captures = {<br> 1 = { name = 'keyword.control.your_LG'; };<br> 2 = { name = 'entity.name.type.call.your_LG'; };<br> };<br>},<br>{ name = 'meta.function.your_LG';<br> match = '^\s*(function)\s+(\S+)';<br> captures = {<br> 1 = { name = 'storage.type.function.your_LG'; };<br> 2 = { name =
'entity.name.function.your_LG'; };<br> };<br>},<br><br><br>If you assign the same name for the 2. match in 'call' and 'function' or you write (function|call) the function name will appear in the same colour.<br><br>And look in other Language Grammars (C, Ruby, Python, ...) since it's a common task.<br><br>Hope it helps a bit.<br><br>Best,<br>--Hans<br><br> </div> </div> </div></body></html>