ISSOtm
930080f556
Mark not unmapping macro-containing files as okay
...
There isn't really a better alternative.
Making several mappings instead requires too much bookkeeping.
2020-10-04 04:46:01 +02:00
ISSOtm
8e7afb0ab3
Move some MSVC-specific defines to platform.h
2020-10-04 04:46:01 +02:00
ISSOtm
138523570e
Fix possible uninitialized read on Windows
2020-10-04 04:46:01 +02:00
ISSOtm
82469ac0fd
Shim around mmap on Windows
2020-10-04 04:46:01 +02:00
ISSOtm
96cb5e10ed
Fix range-dependent dead code in recursion depth check
2020-10-04 04:46:01 +02:00
ISSOtm
b224cab3e0
Harmonize printing distance
2020-10-04 04:46:01 +02:00
ISSOtm
7381d7b92f
Remove unnecessarily nested symbol data union
2020-10-04 04:46:01 +02:00
ISSOtm
dbef51ba05
Move isWhitespace to a place where it makes more sense
2020-10-04 04:46:01 +02:00
ISSOtm
c952dd8a6e
Fix fixed-point constants not working correctly
...
And added a test to check their behavior
2020-10-04 04:46:01 +02:00
ISSOtm
b65ea64a58
Add newlines to all test output
...
MacOS treats them differently, for some reason.
2020-10-04 04:46:01 +02:00
ISSOtm
542b5d18f1
Fix possible capture buffer size overflow
...
Attempt to grow it to the max size first.
Seriously, if this triggers, *how*
2020-10-04 04:46:01 +02:00
ISSOtm
71a0a42cfb
Fix C2x use of static_assert
2020-10-04 04:46:01 +02:00
ISSOtm
ac011fe69f
Use common function to discard comments in macro args
2020-10-04 04:46:01 +02:00
ISSOtm
9e3d7a50e6
Handle comments in line continuations
2020-10-04 04:46:00 +02:00
ISSOtm
e33c2ad6a2
Fix INCLUDE ignoring -MG
2020-10-04 04:46:00 +02:00
ISSOtm
615f1072d9
Fix readFractionalPart never shifting characters
2020-10-04 04:46:00 +02:00
ISSOtm
f7b7a97407
Prevent expanding macro args in comments
...
Also use a cleaner way, instead of hardcoding to capture
2020-10-04 04:46:00 +02:00
ISSOtm
ece6853e0f
Implement opt b and opt g
2020-10-04 04:46:00 +02:00
ISSOtm
b7b03ee451
Fix "REPT 0" not being a no-op
2020-10-04 04:45:59 +02:00
ISSOtm
f9b48c0cad
Fix else working incorrectly from macros
...
Since the "skip ELSE blocks" variable is global, it used to get carried
over from the macro's `if` to the outer's.
2020-10-04 04:45:59 +02:00
ISSOtm
aa76603da9
Add line+col trace info to lexer
2020-10-04 04:45:59 +02:00
ISSOtm
b83b9825f8
Fix _NARG crashing outside of macros
...
And add a test for it
2020-10-04 04:45:59 +02:00
ISSOtm
d641972cde
Fix macro args not being restored when exiting macros
2020-10-04 04:45:59 +02:00
ISSOtm
4d1333e124
Fix incorrect error reporting of INCLUDEd files
2020-10-04 04:45:59 +02:00
ISSOtm
35396e6410
Fix files being unmapped when still referenced by macros
2020-10-04 04:45:59 +02:00
ISSOtm
8d18b39eee
Support missing register tokens
...
Made possible by #491
2020-10-04 04:45:59 +02:00
ISSOtm
ae77893021
Fix file name reporting
...
As noted in the function's code, this is very error-prone, but
will do the job; this needs rewriting due to #491 anyways, so, temporary.
2020-10-04 04:45:59 +02:00
ISSOtm
baeb180acd
Apply error reporting changes to tests
2020-10-04 04:45:58 +02:00
ISSOtm
fd02ffb7bd
Implement __FILE__ symbol
...
Also clean up built-in symbol creation
This is not great, but currently okay.
Should be fixed later, like the rest...
2020-10-04 04:45:58 +02:00
ISSOtm
62ecdce0b0
Fix line-continuation-macro test
2020-10-04 04:45:58 +02:00
ISSOtm
e4f2fad215
Support line continuations in main scope
2020-10-04 04:45:58 +02:00
ISSOtm
3f5f9bcaf0
Fix numeric constant overflow checks
2020-10-04 04:45:58 +02:00
ISSOtm
08867b3cec
Enable catching invalid macro arg 0
2020-10-04 04:45:55 +02:00
ISSOtm
9081feab51
Reinstate macro arg scan distance
...
Used to be broken, so it was removed, but doing so prevents escaping them.
So it was instead put back in, but with corrected behavior
2020-10-04 04:39:27 +02:00
ISSOtm
cf992164f7
Fix lexer capture sometimes not being reset
2020-10-04 04:39:27 +02:00
ISSOtm
b27b821e7f
Fix RAW lexer length underflow
...
Also added an assertion to check against more such overflows
2020-10-04 04:39:26 +02:00
ISSOtm
d9ecaabac1
Add debug tracing code to lexer
...
Hidden behind a #define, like YYDEBUG
2020-10-04 04:39:26 +02:00
ISSOtm
cd747d8175
Fix many lexer bugs
...
More to come...
2020-10-04 04:39:25 +02:00
ISSOtm
df75fd2ec2
Fix expansion reporting being incorrect
2020-10-04 04:38:53 +02:00
ISSOtm
adcaf4cd46
Fix crash when no macro args are being used
2020-10-04 04:38:53 +02:00
ISSOtm
81a77a9b88
Re-implement block copy to avoid expanding macro args
...
They were expanded during the capture, and there was no easy way to
avoid expanding them (believe me, after three hours and somehow an OOM, I
gave up trying).
2020-10-04 04:38:53 +02:00
ISSOtm
6e805cd318
Implement macro args
...
This finally allows running 90% of the test suite, debugging time!
2020-10-04 04:38:53 +02:00
ISSOtm
e11f25024e
Add test for built-in file symbol
...
It's currently defined in fstack.c, making it more prone to accidental
dropping. Let's not repeat the 0.3.9 scenario...
2020-10-04 04:38:53 +02:00
ISSOtm
7c895f8a1b
Fix diagnostic formatting
...
Missing colon and space after the file stack
2020-10-04 04:38:53 +02:00
ISSOtm
38bda7e1bb
Fix string expansion reporting
...
More expansions were allowed than the limit specified, and reporting code
did not account for the extra one that caused overflow
2020-10-04 04:38:52 +02:00
ISSOtm
149db9a022
Fix incorrect freeing of expansions
...
Freeing an expansion should free its children, not its siblings...
Fixes a use-after-free reported by scan-build. Nice catch!
2020-10-04 04:38:52 +02:00
ISSOtm
fed252bc49
Fix nested expansions being incorrectly handled
...
The biggest problem was simply that the length of children expansions was
not accounted for when skipping over the parent... this took a lot of
arduous debugging, but it finally works!
2020-10-04 04:38:52 +02:00
ISSOtm
61b2fd9816
Add string expansion reporting
...
And fix line counting with expansion-made newlines.
This has the same bug as the old lexer (equs-newline's output does not
print the second warning as being part of the expansion).
Additionally, we regress equs-recursion, as we are no longer able to
catch this specific EQUS recursion. Simply enough, the new expansion
begins **after** the old one ends! I have found no way to handle that.
2020-10-04 04:38:52 +02:00
ISSOtm
5ad7a93750
Add EQUS expansion
2020-10-04 04:38:52 +02:00
ISSOtm
2ec10012b6
Fix mmap read offset not being initialized
2020-10-04 04:38:52 +02:00