Minor documentation inconsistency

84 views
Skip to first unread message

Martin Eden

unread,
Feb 5, 2026, 7:57:13 PMFeb 5
to lu...@googlegroups.com
Hello authors,

Looks like "global" declaration statement is put incomplete in
EBNF syntax section:

  https://lua.org/manual/5.5/manual.html#9

  stat ::=
    ...
    global attnamelist |
    ...

It should be

  global attnamelist ['=' explist] |

is the same manner as "local attnamelist".


Also I enjoy dedicated and comfortably dense style of this manual.

-- Martin

Roberto Ierusalimschy

unread,
Feb 7, 2026, 12:49:17 PMFeb 7
to 'Martin Eden' via lua-l
> Looks like "global" declaration statement is put incomplete in
> EBNF syntax section:
>
>   https://lua.org/manual/5.5/manual.html#9
>
>   [...]

Many thanks for the feedback.

-- Roberto

Peter Clayton

unread,
Jul 2, 2026, 8:41:34 PM (7 hours ago) Jul 2
to lua-l
It seems like "global attnamelist" is also wrong in another way: When you don't supply the ['=' explist], it doesn't accept a spread attribute (first attribute shared between all declared values).
Invalid:
    global <const> varA, varB
Valid:
    global <const> varA, varB = 1,2
Valid:
    global varA<const> varB<const>

Also, it seems like it ignores the const-ness of global variables.
Valid:
    > global test<const> = 45
    > test = 23

What's up with that?

-- Peter
Reply all
Reply to author
Forward
0 new messages