softdevteam / grmtools

Rust grammar tool libraries and binaries
Other
507 stars 31 forks source link

write .l with var for lrlex #361

Closed RickSKy closed 1 year ago

RickSKy commented 1 year ago

when we use flex, we can write .l like that:

testline  #\ [0-9]+\ \"
%%
{testline}   return TEST;

testline just like a var or symbol. And flex will replace testline with #\ [0-9]+\ " in %% when compiling; it can improve the readable for the .l file when the regex is complex. It will be nice to write .l with var for lrlex.

ltratt commented 1 year ago

I'm not adverse to having a PR with such a feature, but I can't see that flex uses the term "testline"?