You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- @insert BLARGH( @insert BLARGH() ) -- Error: Preprocessor code not supported in macros.
84
+
-- @insert BLARGH(function() return 1,2 end) -- Syntax error! Caused by the comma in the return statement. (This would work if the preprocessor was smarter.)
85
+
86
+
!local function WHERE(filename, ln) return "print(string.format('We are at %s:%d!', "..filename..", "..ln.."))" end
87
+
@insert WHERE(@file, @line)
88
+
89
+
!(
90
+
local DEBUG = 1==1
91
+
92
+
local function ASSERT(cond, message)
93
+
if not DEBUG then return "" end
94
+
95
+
message = message or "'Asertion failed!'"
96
+
97
+
return "if not ("..cond..") then error("..message..") end"
98
+
end
99
+
)
100
+
101
+
local ok = 1==1
102
+
103
+
@insert ASSERT ( ok , "Oh "..tonumber("7",10).." noes!" )
0 commit comments