Skip to content

Commit

Permalink
fix a luaminify issue and asset files reading.
Browse files Browse the repository at this point in the history
  • Loading branch information
pigpigyyy committed Nov 27, 2023
1 parent 6eee5ff commit 262aaae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions Assets/Script/Lib/WebServer.yue
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,11 @@ luaCheck = (file, content)->
if not item[5]\match("unused") and item[5]\match check
useCheck = false
continue unless useCheck
if item[1] == "type"
item[1] = "warning"
switch item[1]
when "type"
item[1] = "warning"
when "parsing", "syntax"
continue
item
if #info == 0
info = nil
Expand Down Expand Up @@ -560,7 +563,7 @@ HttpServer\post "/assets", ->
children = nil
dirs = Content\getDirs path
for dir in *dirs
if root then switch dir when ".upload", ".download", ".www"
if root then switch dir when ".upload", ".download", ".www", ".build"
continue
elseif dir == ".git"
continue
Expand Down
3 changes: 3 additions & 0 deletions Assets/Script/Lib/luaminify.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,9 @@ local function ParseLua(src)
if not tok:ConsumeKeyword('then', tokenList) then
return false, GenerateError("`then` expected.")
end
if tok:IsSymbol(';') then
tok:Get()
end
local st, nodeBody = ParseStatementList(scope)
if not st then return false, nodeBody end
nodeIfStat.Clauses[#nodeIfStat.Clauses+1] = {
Expand Down
2 changes: 1 addition & 1 deletion Source/Common/Own.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class OwnVector : public std::vector<Own<T>> {
bool fast_remove(const Own<T>& item) {
size_t index = std::distance(OwnV::begin(), OwnVector::index(item));
if (index < OwnV::size()) {
OwnV::at(index) = OwnV::back();
OwnV::at(index) = std::move(OwnV::back());
OwnV::pop_back();
return true;
}
Expand Down

0 comments on commit 262aaae

Please sign in to comment.