Skip to content

Commit

Permalink
Fix SQL syntax matching CFML hash char, closes #70
Browse files Browse the repository at this point in the history
  • Loading branch information
jcberquist committed Apr 6, 2017
1 parent 63d0f48 commit 89cc422
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions syntaxes/cfml.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ contexts:
- include: scope:source.cfml.script#comments
- include: scope:source.cfml.script#expressions
sql-hash-delimiters:
- match: \\(?=#)
scope: constant.character.escape.sql
- match: '##'
scope: constant.character.escape.hash.cfml
- match: '#'
Expand Down
5 changes: 4 additions & 1 deletion syntaxes/tests/syntax_test_cfml.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
<cfquery>SELECT * FROM #obj.property# WHERE s = '#obj.prop#'</cfquery>
<!--- ^^^^^^^^ source.cfml.script source.sql source.cfml.script meta.property.cfml --->
<!--- ^^^^ source.cfml.script source.sql source.cfml.script meta.property.cfml --->
<cfquery>BULK INSERT VAR1 FROM 'C:\#path#'</cfquery>
<!--- ^ source.sql string.quoted.single.sql constant.character.escape.sql --->
<!--- ^ source.sql string.quoted.single.sql constant.character.hash.cfml.start --->
<cfscript>
foo = 'hello world';
<!--- <- embedding.cfml text.html.cfml source.cfml.script variable.other.readwrite.cfml --->
Expand Down Expand Up @@ -78,4 +81,4 @@ myFunc().addVal(10);
<!--- ^ embedding.cfml text.html.cfml source.cfml.script meta.function-call.cfml meta.function-call.parameters.cfml punctuation.definition.group.begin.cfml --->
<!--- ^ embedding.cfml text.html.cfml source.cfml.script meta.function-call.method.cfml --->
<!--- ^ embedding.cfml text.html.cfml source.cfml.script meta.function-call.method.cfml meta.function-call.parameters.method.cfml punctuation.definition.group.begin.cfml --->
</cfscript>
</cfscript>

0 comments on commit 89cc422

Please sign in to comment.