Lua is a language that ignores spaces, tabs, and end-of-line characters (newline and carriage returns).  It also ignores comments between components of a statement (which are called tokens).  This makes Lua what is called a Free-Form Language.

What does that mean? It means that Lua doesn't care how your code is indented.  It only cares about what you actually write.  This allows you to structure your code to make it more readable for you and not to help the compiler determine what is inside a block and outside of a block.

Names

Names in Lua can be any sequence of letters, digits, or underscores beginning with a letter or underscore, and not a keyword.  Names are used to "Name" values (Think variables).  They can also be used as table fields, which are similar to variables except they are stored in a table.

Keywords

Keywords are reserved words that Lua predefined for use in operations and statements.  There are only 22 keywords in Lua that make up the language syntax which can't be used as names.

Lua Keywords

  • and, break, do, else, elsesif, end, false, for, function, goto, if, in, local, nil, not, or, repeat, return, then, true, until, while

An important thing to remember is that Lua is case sensitive.  That means that "or" is a reserved word but "OR", "oR', and "Or" are not!