treeman / tree-sitter-djot

MIT License
31 stars 5 forks source link

Issue parsing standalone comments #33

Closed nbonfils closed 6 months ago

nbonfils commented 6 months ago

Apparently tree-sitter misses the second type of comment mentionned here.

From what I could guess, it seems to me that the issue is due to the space before the inline attribute.


This is not parsed properly:

Foo bar {% This is a comment, spanning
multiple lines %} baz.

result:

(paragraph {)

The following is parsed correctly:

Foo bar{% This is a comment, spanning
multiple lines %} baz.

result:

(paragraph
  (inline_attribute {
   (args
    (comment % (content) %))
   }))
treeman commented 6 months ago

Nice find, thank you!