siraben / tree-sitter-promela

Promela grammar for tree-sitter
MIT License
7 stars 0 forks source link

Macros - preprocessing support #6

Open filipfigzalski opened 8 months ago

filipfigzalski commented 8 months ago

Currently #define and other macros do not work.

filipfigzalski commented 8 months ago

I'm trying to implement the simple version of #define according to this.

This is what I have right now:

preproc_def: $ => seq(
    '#', 'define', $.uname, $.token_string
),

I've never worked with tree-sitter before, so I'm not sure if use of the uname is correct here and what exactly token_string should be.

siraben commented 8 months ago

I saw that Promela uses macros, but unfortunately I think they would be too hard to support fully, because it uses the C preprocessor so in theory it will have to support the full C expression grammar.