m-novikov / tree-sitter-sql

SQL syntax highlighting for tree-sitter
MIT License
110 stars 32 forks source link

CREATE OR REPLACE ignores OR REPLACE #64

Open Wilfred opened 2 years ago

Wilfred commented 2 years ago

Given the following SQL:

CREATE OR REPLACE VIEW geo_state AS
SELECT geom FROM geoheader;

the parser produces:

source_file (0, 3) - (3, 0)
  create_view_statement (0, 3) - (1, 26)
    CREATE (0, 3) - (0, 9) "CREATE"
    VIEW (0, 21) - (0, 25) "VIEW"
    identifier (0, 26) - (0, 35) "geo_state"
    view_body (0, 36) - (1, 26)
      AS (0, 36) - (0, 38) "AS"
      select_statement (1, 0) - (1, 26)
        select_clause (1, 0) - (1, 11)
          SELECT (1, 0) - (1, 6) "SELECT"
          select_clause_body (1, 7) - (1, 11)
            identifier (1, 7) - (1, 11) "geom"
        from_clause (1, 12) - (1, 26)
          FROM (1, 12) - (1, 16) "FROM"
          identifier (1, 17) - (1, 26) "geoheader"
  ; (1, 26) - (1, 27) ";"

There's no node corresponding to OR REPLACE.