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
diff --git a/lcpp.lua b/lcpp.lua
index e60f225..be6c34b 100755
--- a/lcpp.lua+++ b/lcpp.lua@@ -462,7 +462,7 @@ local function parseCInteger(input)
elseif k == "HEX_LITERAL" then
unary, v = v:match('([%+%-]?)0x([a-fA-F%d]+)[UL]*')
local n = tonumber(v, 16)
- table.insert(out, unary..tostring(n))+ table.insert(out, " "..unary..tostring(n))^M
elseif k == "NUMBER_LITERAL" then
v = v:match('([^UL]+)[UL]+')
table.insert(out, v)
I was not sure how to properly make a testcase, still wrapping my head around the mix of lua and cpp in that part of the code :) I'll do a second pass once I get it working in its entirety. (I will probably have to reset/redo the commits anyway in my fork, since among the bugfixes there is also a small feature to implement the search path so one could do "#include <stdio.h>" and have it work. Sorry for creating so many issues, hopefully you do not mind! :)
Try to run make test and see that there are strict testcases for any syntax and logic issues. If there is a bug, construct a valid testcase that we can talk about.
I toyed a bit more and see how they work now. I've dug a few more issues. So I will create a commit with the testcases for all, then create separate commit per issue with the fix, and then make a PR. Would that work ok ?
Activity
ayourtch commentedon Aug 17, 2016
The following diff takes care of it:
m-schmoock commentedon Aug 18, 2016
Hey,
Lets always construct testcases for changes including the issue number like this
Have a leading space in front of hex numbers converted to decimals
ayourtch commentedon Aug 18, 2016
I was not sure how to properly make a testcase, still wrapping my head around the mix of lua and cpp in that part of the code :) I'll do a second pass once I get it working in its entirety. (I will probably have to reset/redo the commits anyway in my fork, since among the bugfixes there is also a small feature to implement the search path so one could do "#include <stdio.h>" and have it work. Sorry for creating so many issues, hopefully you do not mind! :)
m-schmoock commentedon Aug 18, 2016
Try to run
make testand see that there are strict testcases for any syntax and logic issues. If there is a bug, construct a valid testcase that we can talk about.ayourtch commentedon Aug 18, 2016
I toyed a bit more and see how they work now. I've dug a few more issues. So I will create a commit with the testcases for all, then create separate commit per issue with the fix, and then make a PR. Would that work ok ?
m-schmoock commentedon Aug 18, 2016
If its separated and includes testcases, yes absolutely.
Testcase for hex number processing being incorrect
Fix the hex number processing