timtadh / lexmachine

Lex machinary for go.
Other
405 stars 28 forks source link

help! #10

Closed lucyProgramingLang closed 6 years ago

lucyProgramingLang commented 6 years ago

I have problem with match multi line comment!! / comments /

can anyone share the regular expressoion??

timtadh commented 6 years ago

The way to correctly lex c-style /* */ comments is given in the tutorial: http://hackthology.com/writing-a-lexer-in-go-with-lexmachine.html

Edit: I should say, it gives the non-nested version. If you need to handle nesting use the "escape hatch" also explained in that article.