tree-sitter / tree-sitter-go

Go grammar for tree-sitter
MIT License
310 stars 65 forks source link

Incorrect parsing for URLs with parenthesis in them #137

Closed alexaandru closed 8 months ago

alexaandru commented 8 months ago

Given a file that includes:

// https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters

I would expect https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition)_parameters to be parsed as URL. However, when I inspect the parse tree, I see that it says:

(comment ; [28, 0] - [28, 91]
  (source ; [28, 0] - [28, 91]
    (uri))) ; [28, 3] - [28, 79]

it considers it as URL up to, but not including, the closing parenthesis: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_(Select_Graphic_Rendition.

amaanq commented 8 months ago

not a go parser issue

alexaandru commented 8 months ago

My bad, sorry for the noise & thank you for the quick reply.