alex-pinkus/tree-sitter-swift

Does not return result if file ends with a comment

ketkarameya opened this issue · 1 comments

I observed that tree-sitter does not return result when a parsing a file ending with a comment.

import Foundation

class SwiftExamples {

    func test() -> Bool {
      if x && y && z {
      	return true
      }
      
      if x && y && z.def() {
      	return true
      } 
    }
}
// Some comment

Yeah, good catch! This is an easy fix in scanner.c, I should have been more careful about my while loops :(