Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

sql language injection not properly terminated in tagged template literals #601

Open

Description

@spence-s

Prerequisites

Description

Does not properly end SQL language injection in tagged template literals. The npm package sql-template-strings supports a .append function that can be used to chain together a complex sql query. If a parenthesis is opened in one tagged template literal where the injected grammar is sql, the language injection doesn't stop when the template string is terminated.

Steps to Reproduce

  1. Open a .js file
  2. create a a tagged template literal with SQL``
  3. Do something like
const sql = SQL`SELECT * FROM ( SELECT *`
... write more javascript 

The javascript will not be parsed correctly until the parens is closed.

Expected behavior: terminated language injection when template literal is closed

Actual behavior: javascript below will be parsed incorrectly

Reproduces how often: 100%

Versions

Atom : 1.31.1
Electron: 2.0.7
Chrome : 61.0.3163.100
Node : 8.9.3
OS: Ubuntu 16.04

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions