-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.lua
More file actions
123 lines (111 loc) · 1.83 KB
/
Copy pathtest.lua
File metadata and controls
123 lines (111 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
--[===[
fsddsfsdfsdfsf
--]===]
---[[
print 'Lua is love'
--[=[]]
--print 'Lua is life'
--]=]
--[[
--print 'Lua is love'
--[=[]]
print 'Lua is life'
--]=]
--bbb {1}
--aaa(1, 2, 3, 2, b())
-- a = c(1) + 2 * 3
-- c(1) 2 3 * +
--a = 'alo\\n123"'
--a = "alo\\n123\""
--a = '\\97lo\\10\\04923"'
--a = [[alo
--123"]]
--a = [==[
--alo
--123"]==]
--i = 3
--i, a[i] = i+1, 20
--a[i]=2*3*1
--print(1*2+3)
--a=1*2*3
---[[
b = #'1'
function c(printer)
return printer
end
--]]
a = b + (c(print or io.write)('marcoantoniorahalsacoman') or 0)
--]]
---[[
function factorial(n)
local x = 1
for i = 2, n, 1 do
x = x * i
end
return x
end
--]]
--a = { [f(1)] = g; "x", "y"; x = 1, f(x), [30] = 23; 45 }
--print(b())
--print(1)
a = 1 * 2 + factorial(1)
print(a)
print(factorial(4))
x = 10 -- global variable
do -- new block
local x = x -- new 'x', with value 10
print(x) --> 10
x = x + 1
do -- another block
local x = x + 1 -- another 'x'
print(x) --> 12
end
print(x) --> 11
end
print(x) --> 10 (the global one)
print 'asasdasd'
print {}
---[[
a = {}
local x = 20
for i = 1, 10 do
--l = function () end
local y = 0
a[i] = function ()
y = y + 1;
return x + y
end
end
print(print(a))
if a[1] then
print(a[1]())
print(a[2]())
end
repeat
local a = true
print('a')
until a
--]]
--[[
print(
factorial(
1
)
)
functioncall {
prefixexp: {
var: "print"
}
args: {
functioncall {
prefixexp: {
var: "factorial",
}
args: {
exp: 1
}
}
}
}
--]]
--1