1.1程序块
a = 1
b = a * 2
a = 1;
b = a * 2;
a = 1;b = a * 2
a = 1 b = a * 2
4个都是合法的程序块
1.2词法规范
①Lua区分大小写
②Lua标识符不允许以数字开头,不允许以下划线加大写字母开头
③Lua保留字:
and break do else elseif
end false goto for function
if in local nil not
or repeat return then true
until while
④行注释:–
⑤块注释:
–[[
print(10) – no action (commented out)
–]]
1.3 全局变量
b = 10 就创建了全局变量
b = nil 就删除了全局变量