janet-lang / spork

Various Janet utility modules - the official "Contrib" library.
MIT License
122 stars 35 forks source link

fmt/make-tree discards comments sometimes #19

Closed sogaiu closed 3 years ago

sogaiu commented 3 years ago

Comments are discarded sometimes by fmt/make-tree:

repl:1:> (make-tree "# a comment")
(:top @[])
repl:2:> (make-tree "# a comment\n# another comment")
(:top @[])

Perhaps as long as there is at least one thing which is not a comment nor whitespace this doesn''t happen:

repl:3:> (make-tree "# a comment\n1")
(:top @[(:comment " a comment") (:span "1")])