Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error when file does not end in newline or semicolon #166

Closed
nmote opened this issue Apr 27, 2022 · 1 comment
Closed

Parse error when file does not end in newline or semicolon #166

nmote opened this issue Apr 27, 2022 · 1 comment

Comments

@nmote
Copy link
Contributor

nmote commented Apr 27, 2022

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
nmote added a commit to nmote/tree-sitter-swift that referenced this issue Apr 27, 2022
See alex-pinkus#166

```
$ echo -n "print(3)" > nonewline.swift
$ npx tree-sitter parse nonewline.swift # No parse error
```
alex-pinkus pushed a commit that referenced this issue Apr 28, 2022
See #166

```
$ echo -n "print(3)" > nonewline.swift
$ npx tree-sitter parse nonewline.swift # No parse error
```
@alex-pinkus
Copy link
Owner

Thank you for both finding and fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants