Search code examples
luavariable-assignmentassignment-operator

What does :: (double-colon) mean before an assignment in lua?


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 =?


Solution

  • 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.