lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 11/22/2010 1:28 PM, Roberto Ierusalimschy wrote:
Checking my other pet-peeve I noticed that it's still there:

   print("%d":format(42))    -->  error: ')' expected near ':'
   print(("%d"):format(42))  -->  42

I still have to add these superfluous parentheses around the string.
As far as I can see, there's no real reason for the parentheses.

I've attached a patch to remove this requirement (patch1).

Please, do not send patches; they show the implementation, not the idea.
For what you are proposing, a BNF would be more useful. Show how Lua's
BNF should be modified.

-- Roberto



Would changing
prefixexp ::= var | functioncall | ‘(’ exp ‘)’
to
prefixexp ::= var | functioncall | ‘(’ exp ‘)’ | String
work ?

Pavel