@@ -21,7 +21,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
21
21
operatorChars = parserConfig . operatorChars || / ^ [ * + \- % < > ! = & | ~ ^ ] / ,
22
22
support = parserConfig . support || { } ,
23
23
hooks = parserConfig . hooks || { } ,
24
- dateSQL = parserConfig . dateSQL || { "date" : true , "time" : true , "timestamp" : true } ;
24
+ dateSQL = parserConfig . dateSQL || { "date" : true , "time" : true , "timestamp" : true } ,
25
+ backslashStringEscapes = parserConfig . backslashStringEscapes !== false
25
26
26
27
function tokenBase ( stream , state ) {
27
28
var ch = stream . next ( ) ;
@@ -125,7 +126,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
125
126
state . tokenize = tokenBase ;
126
127
break ;
127
128
}
128
- escaped = ! escaped && ch == "\\" ;
129
+ escaped = backslashStringEscapes && ! escaped && ch == "\\" ;
129
130
}
130
131
return "string" ;
131
132
} ;
@@ -292,6 +293,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
292
293
builtin : set ( "bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table " ) ,
293
294
atoms : set ( "false true null unknown" ) ,
294
295
operatorChars : / ^ [ * + \- % < > ! = ] / ,
296
+ backslashStringEscapes : false ,
295
297
dateSQL : set ( "date datetimeoffset datetime2 smalldatetime datetime time" ) ,
296
298
hooks : {
297
299
"@" : hookVar
0 commit comments