[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: omit parenthesis for functions of zero
- From: Gavin Wraith <gavin@...>
- Date: Thu, 02 Mar 2006 09:06:51 GMT
<20060228103234.AF7A714170@bazar2.conectiva.com.br>
<376dd1950603012224q1b93bd25r4d785cad73818e5e@mail.gmail.com>
In-Reply-To:
<376dd1950603012224q1b93bd25r4d785cad73818e5e@mail.gmail.com>
X-Organization: Home
User-Agent: Messenger-Pro/1.00c (MsgServe/1.00a) (RISC-OS/5.11) POPstar/2.05
Reply-To: lua@bazar2.conectiva.com.br
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
In message
<376dd1950603012224q1b93bd25r4d785cad73818e5e@mail.gmail.com>
you wrote:
> On 2/28/06, Gavin Wraith <gavin@wra1th.plus.com> wrote:
> > Permit me to puff RiscLua's brand of mild sugar, requiring
> > only a couple of extra lines in llex.c:
> >
> > RiscLua: \ () => foo + bar end
> >
> i'm interested in seeing your patch. can i take a look at it?
> are there any side effects wrt the rest of the language?
>
> any thoughts about Gavin's tweak from the rest of the list?
---- diff for llex.c,v 2.19 2006/02/06 18:28:16 roberto
in static int llex (LexState *ls, SemInfo *seminfo) { ...
Replace, at line 368
-- case '=': {
-- next(ls);
-- if (ls->current != '=') return '=';
-- else { next(ls); return TK_EQ; }
-- }
with
++ case '=': {
++ next(ls);
++ switch(ls->current) {
++ case '=': next(ls); return TK_EQ; break;
++ case '>': next(ls); return TK_RETURN; break;
++ default: return '='; }
++ }
++ case '\\': {
++ next(ls);
++ return TK_FUNCTION;
++ }
--
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/