Skip to content

[SQL] Incorrect highlighting of a string containing only a \ #630

@ciaccia

Description

@ciaccia

Wrong highlighting with SQL (build 3124)

Consider the following (PostgreSQL) SQL script:

CREATE TABLE tab
(
  id bigserial,
  data text
);

INSERT INTO tab(id, data) values (1, '_');
-- CORRECT: This line is grey

INSERT INTO tab(id, data) values (2, '\');
-- WRONG: This line is yellow, it should be *GREY*

Expected behaviour

The last line should be considered a comment an be grey.

Actual behaviour

The last line is yellow, since the SQL parser does not correctly close the '' string (it thinks the last single quote is escaped, which in SQL is not).

Steps to reproduce

  1. Open Sublime Text 3124 with standard settings
  2. Create a new file, paste the above content in it and save it as bug.sql.
  3. The last color is grey instead yellow

Environment

  • Operating system and version:
    • Mac OS X 10.11.6
  • Sublime Text:
    • Build 3124

Metadata

Metadata

Assignees

No one assigned

    Labels

    T: bugA bug in an existing language feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions