Re: Ternary operator patch
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Ternary operator patch
- From: "Juris Kalnins" <juris@...>
- Date: 2010年9月15日 14:09:32 +0300
If you want to make a statement about the function of \n in the Lua
language, please write it into a complete file you feed into Lua (and
obviously not via input redirection).
From lparse.c:609
static void funcargs (LexState *ls, expdesc *f) {
FuncState *fs = ls->fs;
expdesc args;
int base, nparams;
int line = ls->linenumber;
switch (ls->t.token) {
case '(': { /* funcargs -> `(' [ explist1 ] `)' */
if (line != ls->lastline)
luaX_syntaxerror(ls,"ambiguous syntax (function call x new
statement)");
.....
That if checks and fails if there is newline before '(' where function
arguments are expected
Example file:
======8<==========8<=========
print
(1)
======8<==========8<=========
- References:
- Re: Ternary operator patch, Henk Boom
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Geoff Leyland
- Re: Ternary operator patch, steve donovan
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Miles Bader
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Jonathan Castello
- Re: Ternary operator patch, Roberto Ierusalimschy
- Re: Ternary operator patch, Enrico Tassi
- Re: Ternary operator patch, Doug Rogers
- Re: Ternary operator patch, Fabien
- Re: Ternary operator patch, David Kastrup
- Re: Ternary operator patch, Fabien
- Re: Ternary operator patch, David Kastrup