Author Topic: Lua Multiline Nested Quote Support  (Read 2841 times)

PiezonTM

  • Senior Community Member
  • Posts: 140
  • Hero Points: 8
Lua Multiline Nested Quote Support
« on: May 22, 2013, 04:49:08 PM »
It would be nice if SE could properly handle multiline nested quotes (see http://lua-users.org/wiki/StringsTutorial). 

For example,
[[one [[two]] one]]        -- bad
[=[one [[two]] one]=]      -- ok
Outputs: one [[two]] one

You can add any number of '=' between the starting "[[" and it will look for the terminating "]]" that has the same number of '=' characters.  SE handles the basic "[[ something ]]", but not the nested quotes (e.g. "[==[ something [[ nested ]] ]==]").

This is not unique to the beta, but is still a problem with the beta.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1299
  • Hero Points: 130
Re: Lua Multiline Nested Quote Support
« Reply #1 on: May 22, 2013, 08:26:10 PM »
That was a limitation in the original implementation.  There is a bit more flexibility now in the lexer, we should be able to handle long strings (up to a limit anyway).  I will try to get this in for next beta.

Long comments using the '=' separator:
Quote
--[=[ ... ]=]
still needed to be added to lexer manually as start and end pairs if you are using them.

PiezonTM

  • Senior Community Member
  • Posts: 140
  • Hero Points: 8
Re: Lua Multiline Nested Quote Support
« Reply #2 on: May 23, 2013, 11:36:54 AM »
Thanks for the information.  Just to be clear I was referring to multi-lined strings, not comments.  I can manually add the comment format myself even though it is not complete--since you can have any number of '=' characters.  I've added just the basic "--[=[" "]=]" to the comments--this addition might be a worthy default as well for the Lua profile.