alex-pinkus/tree-sitter-swift

Parse error when file does not end in newline or semicolon

nmote opened this issue · 1 comments

nmote commented

This came up because basic Semgrep patterns are often given on only one line, so it's a problem if they can't be parsed.

Steps to reproduce:

  1. $ echo -n "print(3)" > nonewline.swift
  2. $ npx tree-sitter parse nonewline.swift # Parse error
  3. $ swift nonewline.swift # prints 3

Thank you for both finding and fixing this!