Closed ihathbeer closed 2 months ago
A potential fix is to push a newline here if no LF/CR is present in the buffer about to be pushed to the stack: https://github.com/MikePopoloski/slang/blob/cad562f821a575728e65f5414375c7cb94d2d124/source/parsing/Preprocessor.cpp#L520-L521
Happy to put a PR up if you agree.
Agree. Two lines of code are concatenated into one, as in "define SOMETHING 2include \"defs.svh\"", which results in an error.
I think the right place is actually here: https://github.com/MikePopoloski/slang/blob/cad562f821a575728e65f5414375c7cb94d2d124/source/parsing/Preprocessor.cpp#L439
If there's no EndOfLine at the end of the trivia you can add one. I'd be happy to take a PR.
Describe the bug Inlining 1-line header files with no CR/LF (carriage return / line feed) into source files compiled as a single compilation unit can result in the macro contents being prepended with the `include directive, which later causes the macro definitions to not be found.
I have noticed some editors (VScode) do not add a carriage return or line feed, so you can end up with something like this:
To Reproduce Use the command I've posted above on the files attached or run this command:
You'll get the following:
inlining-repro.zip