Skip to content

blank lines not properly parsed in 0.3.1 #345

Closed
@mmoncure

Description

@mmoncure

parsing the following valid SQL:

  SELECT

    a,
    b,

    c,
    d
  FROM foo f;

...yields

DT7FN214T3:processor merlin.moncure$ ~/pgtools/pgtools check --skip-db ~/pgtools/test.sql
/Users/merlin.moncure/pgtools/test.sql:3:5 syntax ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Invalid statement: syntax error at or near "a"

    1 │   SELECT
    2 │
  > 3 │     a,
      │     ^^
  > 4 │     b,
      │     ^^
    5 │
    6 │     c,


/Users/merlin.moncure/pgtools/test.sql:6:5 syntax ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Invalid statement: syntax error at or near "c"

    4 │     b,
    5 │
  > 6 │     c,
      │     ^^
  > 7 │     d
  > 8 │   FROM foo f;·
      │   ^^^^^^^^^^^
    9 │


Checked 1 file in 1399µs. No fixes applied.
Found 2 errors.
check ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Some errors were emitted while running checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions