lua-users home
lua-l archive

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


On 01/29/2017 10:56 AM, Egor Skriptunoff wrote:
> On Mon, Jan 30, 2017 at 7:46 AM, Martin <eden_martin_fuhrspam@gmx.de
> <mailto:eden_martin_fuhrspam@gmx.de>> wrote:
> 
> 
>     return 'Whoops! someone ate tail apostrophe...
> 
> 
> Any character inside any variable name can be eaten too,
> and horrible thing (global variable is used instead of local one)
> happens.
> Nevertheless you can live happily with it.
> 
> Closing "end" of some block (for-end, do-end, function-end)
> could be eaten too, and Lua raises error
> "'end' expected near ..."
> without giving you a knowledge about the line#
> where the error actually happened.
> Usually error message points to the very end of your file.
> Nevertheless you can live happily with it.
> 
> The situation with apostrophe been eaten does not introduce
> "horrible things" which previously do not exist in Lua.

Point is in --'. It happily closes multiline apostrophe quote.

More correct example is

return whoops 'someone ate tail apostrophe...
and "where is your code highlighting now?"
--'

it syntactically correct both ways. Same problem may be with long quotes
too, --]] comments are very common but it's hard to lose ]] closing comment.