Skip to content

Commit

Permalink
fix(lax): removes the concept of lax-tl and .lax.tl files
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-Mitchell committed Dec 16, 2024
1 parent db12d8b commit 8e41aa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
14 changes: 2 additions & 12 deletions tl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2345,7 +2345,6 @@ end




do


Expand Down Expand Up @@ -6947,10 +6946,6 @@ tl.search_module = function(module_name, search_dtl)
if found then
return found, fd
end
found, fd, tried = search_for(module_name, ".lax.tl", path, tried)
if found then
return found, fd
end
found, fd, tried = search_for(module_name, ".lua", path, tried)
if found then
return found, fd
Expand Down Expand Up @@ -13404,16 +13399,11 @@ end
local function lang_heuristic(filename, input)
if filename then
local pattern = "(.*)%.([a-z]+)$"
local front, extension = filename:match(pattern)
local _, extension = filename:match(pattern)
extension = extension and extension:lower()

if extension == "tl" then
local _, subextension = front:match(pattern)
if (subextension == "lax") then
return "lax-tl"
else
return "tl"
end
return "tl"
elseif extension == "lua" then
return "lua"
end
Expand Down
14 changes: 2 additions & 12 deletions tl.tl
Original file line number Diff line number Diff line change
Expand Up @@ -2343,7 +2343,6 @@ end
local enum ParseLang
"lua"
"tl"
"lax-tl"
end

do -----------------------------------------------------------------------------
Expand Down Expand Up @@ -6947,10 +6946,6 @@ tl.search_module = function(module_name: string, search_dtl: boolean): string, F
if found then
return found, fd
end
found, fd, tried = search_for(module_name, ".lax.tl", path, tried)
if found then
return found, fd
end
found, fd, tried = search_for(module_name, ".lua", path, tried)
if found then
return found, fd
Expand Down Expand Up @@ -13404,16 +13399,11 @@ end
local function lang_heuristic(filename?: string, input?: string): ParseLang
if filename then
local pattern = "(.*)%.([a-z]+)$"
local front, extension = filename:match(pattern)
local _, extension = filename:match(pattern)
extension = extension and extension:lower()

if extension == "tl" then
local _, subextension = front:match(pattern)
if (subextension == "lax") then
return "lax-tl"
else
return "tl"
end
return "tl"
elseif extension == "lua" then
return "lua"
end
Expand Down

0 comments on commit 8e41aa2

Please sign in to comment.