alecthomas / participle

A parser library for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Import `regexp/syntax` into generated lexer

ztcollazo opened this issue · comments

Hello. I am building a lexer and parser using participle, and I read the part about generating Go code from a stateful lexer and decided to try it. So far, it has worked like a charm, except for one small thing. Every time I generate the lexer, I have to manually go in and import regexp/syntax so that it stops erroring. I was wondering if this could be added to the template, even conditionally. Thanks in advance.

It would be good to have an example of the code and error you're seeing, as I can't replicate this with _examples/thrift.

Dug through the code and found it, thanks for the report.