lua-users home
lua-l archive

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


Hi all,

According to the spec (as Francisco has quoted above): It's only a short comment if the double hyphen is not followed immediately by an opening long bracket. Therefore the comment in my example cannot be a short/line comment.

On the other hand, the comment can't be a valid long comment either. Because there is no corresponding closing long bracket!

So, there is no valid way to parse the comment. Again, this conclusion is based on the Lua specification.

Bachir

On Sun, Oct 1, 2023 at 8:18 PM Paul Ducklin <pducklin@outlook.com> wrote:
>So, is that parsed as a long or as a
>short comment?

As Paul K explained, it’s a regular comment.

It would only be the start of a long comment if it had *two* square brackets after the double-dash characters.

(You can add one or more equals signs between the square brackets if you want, to create a unique marker.)