Skip to content

Commit 532ae31

Browse files
haskellcamargomarijnh
authored andcommitted
[sql mode] Remove non-strict useless comparison for booleans
1 parent 90819c5 commit 532ae31

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

mode/sql/sql.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
3232
if (result !== false) return result;
3333
}
3434

35-
if (support.hexNumber == true &&
35+
if (support.hexNumber &&
3636
((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/))
3737
|| (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) {
3838
// hex
3939
// ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html
4040
return "number";
41-
} else if (support.binaryNumber == true &&
41+
} else if (support.binaryNumber &&
4242
(((ch == "b" || ch == "B") && stream.match(/^'[01]+'/))
4343
|| (ch == "0" && stream.match(/^b[01]+/)))) {
4444
// bitstring
@@ -48,7 +48,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
4848
// numbers
4949
// ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html
5050
stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/);
51-
support.decimallessFloat == true && stream.eat('.');
51+
support.decimallessFloat && stream.eat('.');
5252
return "number";
5353
} else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) {
5454
// placeholders
@@ -58,8 +58,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
5858
// ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
5959
state.tokenize = tokenLiteral(ch);
6060
return state.tokenize(stream, state);
61-
} else if ((((support.nCharCast == true && (ch == "n" || ch == "N"))
62-
|| (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i)))
61+
} else if ((((support.nCharCast && (ch == "n" || ch == "N"))
62+
|| (support.charsetCast && ch == "_" && stream.match(/[a-z][a-z0-9]*/i)))
6363
&& (stream.peek() == "'" || stream.peek() == '"'))) {
6464
// charset casting: _utf8'str', N'str', n'str'
6565
// ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
@@ -84,12 +84,12 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
8484
return state.tokenize(stream, state);
8585
} else if (ch == ".") {
8686
// .1 for 0.1
87-
if (support.zerolessFloat == true && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) {
87+
if (support.zerolessFloat && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) {
8888
return "number";
8989
}
9090
// .table_name (ODBC)
9191
// // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html
92-
if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) {
92+
if (support.ODBCdotTable && stream.match(/^[a-zA-Z_]+/)) {
9393
return "variable-2";
9494
}
9595
} else if (operatorChars.test(ch)) {

0 commit comments

Comments
 (0)