[SVN] Re: [PATCH] (ShellScript) Patch to “New Function”: add parentheses after function name

Martin Kühl martin.kuehl at gmail.com
Mon Jan 19 22:25:44 UTC 2009


On Sun, Jan 18, 2009 at 22:23, Allan Odgaard <mailinglist at textmate.org> wrote:
> Great to see the shell bundle receive some love! :)

Hehe :-)

> I wonder though, if this is only to satisfy the highlight, why not
> improve the grammar instead to match functions without ()?

Then that's what I'm going to do. :-)

> It looks like the grammar just matches '«something» ()' as a function,
> but really, it is the function keyword that marks a function, right?
> So we can have the grammar match based on that instead.

No, both the parens _and_ the keyword can mark something as a
function. The keyword makes the paren optional though.
But yes, we can have the grammar use that.

(I guess it's a stylistic preference that I like adding the parens anyway.)

Cheers,
Martin

> On 17 Jan 2009, at 15:39, Martin Kühl wrote:
>
>> Hi all,
>>
>> the current "New Function" command uses the "funcion $name {…}" format
>> for shell functions, which the shell script grammar doesn't highlight
>> correctly.
>> This patch applies the easy fix of just using the "function $name ()
>> {…}" form instead.
>>
>> Thanks,
>> Martin
>>
>> Patch on pastie:
>> http://pastie.textmate.org/private/wwnskgqicpf0vxcmic8lha
>> <pastie-363251.diff>_______________________________________________
>> textmate-dev mailing list
>> textmate-dev at lists.macromates.com
>> http://lists.macromates.com/listinfo/textmate-dev
>
> _______________________________________________
> textmate-dev mailing list
> textmate-dev at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate-dev
>



More information about the textmate-dev mailing list