VSCode-SystemVerilog icon indicating copy to clipboard operation
VSCode-SystemVerilog copied to clipboard

LSP: Replace Macros with TokenStreamRewriter

Open eirikpre opened this issue 6 years ago • 0 comments

To preserve the correct locations and direct link to the source, replacement of macros should happen between the lexer and the parser instead of before the lexer. This can be done with a TokenStreamRewriter, I propose the following approach:

  1. Add a lexer rule for macros (`)
  2. Replace above rule with either the content of the macro or a placeholder.

*Content of a defined macro can be obtained during indexation. **This might be a quite hard task, perhaps start with just substituting the macro for a simple 'placeholder' word

eirikpre avatar Jan 07 '20 08:01 eirikpre