Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Lexing of `protected/`endprotected sections can never complete #899
The lexer (in both preprocessing and parsing) uses yymore() to concatenate the data inside a
I think the solution would be to not concatenate the entire section into a VP_TEXT token and instead create many VP_TEXT tokens and ignore them incrementally if they come in. But I think this has consequences for the rest of the parser that become quite ugly (and would ultimately change how Verilog::Parser callbacks operate).
As a workaround I just remove these sections prior to handing text to the Preprocessor/Parser/etc.. but for other use-cases discarding this data would be incorrect.
Original Redmine Comment
Fixed in git towards 3.413.
The preprocessor had a similar issue, for that returning it line by line is fine.
For the parser I added a use_protected argument, which is 1 for backward compatibility, but vhier and the SigParser don't need protected regions so set use_protected = 0.