I am currently looking through the first page of documentation for LUA and noticed that every assignment appears as var ::= Name, however I could not find any reference to the syntax of ::= itself. The documentation goes over the structuring of an assignment but glosses over these symbols. What I want to know is if every assignment requires the :: before the actual assignment operator, and, if so, why is it structured this way and not just a plain =?
2 Answers
What you're seeing is not Lua code, but a fragment of the grammar of the Lua language, as defined in Backus-Naur Form. The ::= operator is part of BNF.
1 Comment
Silent Pants
Thanks for clearing that up! I wish there was some way to tell what are BNF symbols and what is not without knowing all the symbols in the first place. Perhaps they should bold/italicize or something.
Here is the complete syntax of Lua in extended BNF(c)Lua manual. See BNF description