Module preprocessor

Module preprocessor 

Source
Expand description

C Preprocessor simulation layer

This module provides a lightweight preprocessing layer that handles common C macros without requiring actual header files. Unlike a real preprocessor, this doesn’t expand macros textually but instead helps tree-sitter parse code that uses common macro patterns.

Key strategies:

  1. Macro recognition: Identify and annotate common macro patterns
  2. Attribute simulation: Convert attribute and similar to parseable form
  3. Kernel macro handling: Special support for Linux kernel macros

Structs§

CPreprocessor
C Preprocessor simulation for better parsing
MacroInfo
Information about a recognized macro

Enums§

MacroKind
Known macro patterns and their semantic meaning