0

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

1
  • 4
    Here is the complete syntax of Lua in extended BNF (c)Lua manual. See BNF description Commented May 24, 2021 at 0:04

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

It's the assignment operator - typically used in formal grammars.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.