tree-sitter / tree-sitter

An incremental parsing system for programming tools
https://tree-sitter.github.io
MIT License
18.03k stars 1.36k forks source link

Use the internal regexp in external scanners #2620

Open toots opened 1 year ago

toots commented 1 year ago

Hi!

Thanks for the work on this, it's fantastic!

I'm writing a grammar for liquidsoap and I need to implement an external scanner that matches variable names using regular expressions that involve unicode character properties.

It seems that, by default, C and C++ do not have built-in support for matching these character properties and I would like to avoid adding an external dependency to my parser.

Is there a way to re-use the unicode-aware regular expressions from the internal parser in an external scanner?

Thanks for y'all work and help!

ahlinc commented 1 year ago

It's not possible for now but we have a plan to add such feature.