mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
add some temporary solution (don't look)
This commit is contained in:
parent
8c37d0860c
commit
6b07f062d7
1 changed files with 14 additions and 0 deletions
|
|
@ -57,8 +57,22 @@ local patterns = {
|
|||
{name="sint", pattern="sin(t)"},
|
||||
{name="sint2", pattern="sin(t * 2)"},
|
||||
}
|
||||
local exclude_patters = {
|
||||
"end",
|
||||
(string.pattern_safe("'")),
|
||||
(string.pattern_safe('"')),
|
||||
(string.pattern_safe("--")),
|
||||
(string.pattern_safe("..")),
|
||||
}
|
||||
|
||||
-- TODO: replace with actual expression -> lua translator
|
||||
local function process_expression(src, memoised)
|
||||
for i, pattern in ipairs(exclude_patters) do
|
||||
if src:find(pattern) then
|
||||
debug.print(exclude_patters)
|
||||
error("invalid syntax "..string.escape(src))
|
||||
end
|
||||
end
|
||||
for i, pattern in ipairs(patterns) do
|
||||
local pattern_safe = string.pattern_safe(pattern.pattern)
|
||||
if src:find(pattern_safe) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue