Skip to content
This repository has been 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
spence-s opened this issue Sep 28, 2018 · 0 comments
Open

Comments

@spence-s
Copy link

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

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

No branches or pull requests

1 participant