Hi Adam,

Thank you for your answer. The thing is that the function name is arbitrary(determined by the programmer just like freely named variables)

I can define a function with:

function xyz_any_function_name
...code
end function

The word function and end function are defined as reserved keywords and as such get a color blue(or whatever)

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".

Is that possible?

Thanks
John


From: Adam Strzelecki <ono@java.pl>
To: John Relosa <john.relosa@yahoo.com>; TextMate users <textmate@lists.macromates.com> 
Sent: Thursday, December 29, 2011 8:55 AM
Subject: Re: [TxMt] Coloring for a function call

> How would I make it so the "my_function_name" has a different color after the "call" keyword ? 


I guess you need to group the function name via your lang grammar regular expression and assign some scope to it like "support.function.any-method.yourlang", similar way as you already do keyword scope assign for `call`.

By default themes expect "support.function" scope prefix for standard built-in functions (like time() free() malloc() for C), and "support.function.any-method" prefix for other non-standard, non-built in, user defined functions.

Regards,

Adam Strzelecki

Message: 9
Date: Wed, 28 Dec 2011 08:45:02 -0800 (PST)
From: John Relosa <john.relosa@yahoo.com>
To: "textmate@lists.macromates.com" <textmate@lists.macromates.com>
Subject: [TxMt] Coloring for a function call
Message-ID:
    <1325090702.17456.YahooMailNeo@web121902.mail.ne1.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello,

I am trying to create a bundle where in the particular language after a function definition you would call that function with:

[code....]

function my_function_name
.
.
code

.
.
end function

...more code...

call my_function_name

[/code....]


Now for the question to the TxMt gurus:

How would I make it so the "my_function_name" has a different color after the "call" keyword ??

I have already made the "call" to be a reserved keyword colored blue but if would be nice to have the "my_function_name" function colored red or some other catchy color after the word "call"

Is that possible and what would be the syntax for the bundle?

Thanks in advance.

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20111228/5a5b2143/attachment-0001.html>