Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes failed ifdef "skipping to next macro" warning #20

Merged
merged 1 commit into from
Nov 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lua/wire/client/hlzasm/hc_preprocess.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
--------------------------------------------------------------------------------
-- Load file
function HCOMP:LoadFile(filename)
return file.Read("data/"..self.Settings.CurrentPlatform.."Chip/"..filename, "GAME") -- So we also get /addons/wire/data/

Check warning on line 12 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 12 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 12 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
end

-- Save file
function HCOMP:SaveFile(filename,text)
file.Write(self.Settings.CurrentPlatform.."Chip/"..filename,text)

Check warning on line 17 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

Check warning on line 17 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator
end

-- Trim spaces at string sides
Expand All @@ -34,12 +34,12 @@
-- Find out macro name and parameters
local macroNameEnd = (string.find(macroLine," ") or 0)
local macroName = trimString(string.sub(macroLine,2,macroNameEnd-1))
local macroParameters = trimString(string.sub(macroLine,macroNameEnd+1))

Check warning on line 37 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace before the operator

-- Stop parsing macros inside of a failed ifdef/ifndef
if self.SkipToEndIf then
if macroName == "endif" or macroName == "else" then
if self.EndIfsToSkip > 0 then

Check warning on line 42 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Trailing whitespace"

Trailing whitespace
self.EndIfsToSkip = self.EndIfsToSkip - 1
else
self.SkipToEndIf = false
Expand All @@ -49,7 +49,6 @@
if macroName == "ifdef" or macroName == "ifndef" then
self.EndIfsToSkip = self.EndIfsToSkip + 1
end
self:Warning("skipping to next macro after checking "..macroName)
local InComment = false
-- If this while loop hits end of file before #endif it won't produce an error, seems like the original behavior for ifdefs
while self:getChar() ~= "" do
Expand Down Expand Up @@ -77,11 +76,11 @@
end

if macroName == "pragma" then
local pragmaName = string.lower(trimString(string.sub(macroParameters,1,(string.find(macroParameters," ") or 0)-1)))

Check warning on line 79 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
local pragmaCommand = trimString(string.sub(macroParameters,(string.find(macroParameters," ") or 0)+1))

Check warning on line 80 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'

if pragmaName == "set" then
local entryName = trimString(string.sub(pragmaCommand,1,(string.find(pragmaCommand," ") or 0)-1))

Check warning on line 83 in lua/wire/client/hlzasm/hc_preprocess.lua

View workflow job for this annotation

GitHub Actions / lint

"Whitespace style"

Style: Please put some whitespace after ')'
local entryValue = trimString(string.sub(pragmaCommand,(string.find(pragmaCommand," ") or 0)+1))

if entryValue == "true" then
Expand Down
Loading