Lua identifiers contain numbers, letters, and underscores, and numbers cannot begin with identifiers.
And break do else ElseIf end
False for function Goto if in
Local nil not OR repeat return
Then true until while
The above can not be used as a keyword, and Java is different goto,local,nil,repeat,until.
Lua is case-sensitive. By convention, the underscore begins with a reserved word, followed by the uppercase letter Lua.
+-*/% ^ # = = ~= <= >= < > = () {} []::; : , . .. ...
A string in Lua can also contain escape sequences, such as \n,\t, if a true escape sequence needs to be represented in a string, followed by an escape sequence after a backslash, such as \\n
The string can also be specified in \xxx and \ddd, and the string in Lua can represent any 8-bit value, and the embedded 0 is specified as '/'.
LUA can build strings with [and = mates, such as A=[[ASDQW]], which is level 0
a=[==[dasd]==] This is level 2, the level is determined by the number of equals sign
For convenience, the newline character is not included in the string, as shown in--a, when the opening brace is immediately followed by a newline character. As an example, in a system that uses ASCII (where ' a ' is encoded as 97, the newline character is encoded as 10, ' 1 ' is encoded as 49), the following five literal strings represent the same string:
A = ' alo \ n123 '
A = "alo \ n123 \" "
A = ' \ 97lo \ 10 \ 04923 "'
A = [[Alo
123 "]
A = [= = [\\--a
Alo
123 "] = =]
Numeric constants can be marked with E or E, and Lua accepts hexadecimal numbers, beginning with 0x or 0X. Hexadecimal constants can also accept decimal and binary indices, marked with ' P ' or ' P '.
3 3.0 3.1416 314.16e-2 0.31416E1
0xFF 0x0.1e 0xa23p-4 0x1.921fb54442d18p+1
Single-line comment with--, multiple lines in--(or-? ) and parentheses.
LUA Vocabulary Conventions