Skip to content

Commit

Permalink
SQL Quoted variables are now greedy (#1510)
Browse files Browse the repository at this point in the history
Behavior with quoted variables was incorrect for SQL. This fixes that issue
by introducing a new regex for variables and making the current regex greedy.

Fixes #1509.
  • Loading branch information
RunDevelopment authored and mAAdhaTTah committed Aug 23, 2018
1 parent 3e1a9a3 commit 42d119a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
12 changes: 9 additions & 3 deletions components/prism-sql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/prism-sql.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion tests/languages/sql/variable_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ ar"
ar'
@`fo\`o-b
ar`
@'foo'
@'bar'

----------------------------------------------------

Expand All @@ -14,7 +16,9 @@ ar`
["variable", "@foo_bar_42"],
["variable", "@\"fo\\\"o-b\r\nar\""],
["variable", "@'fo\\'o-b\r\nar'"],
["variable", "@`fo\\`o-b\r\nar`"]
["variable", "@`fo\\`o-b\r\nar`"],
["variable", "@'foo'"],
["variable", "@'bar'"]
]

----------------------------------------------------
Expand Down

0 comments on commit 42d119a

Please sign in to comment.