Skip to content
Snippets Groups Projects
Commit eafb2cad authored by santec's avatar santec Committed by Marijn Haverbeke
Browse files

[sql mode] Minor fixes

* index.html included codemirror.js twice
* optimize .tableName syntax check
parent 9fcee65e
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,6 @@
<title>SQL Mode for CodeMirror</title>
<link rel="stylesheet" href="../../lib/codemirror.css" />
<script src="../../lib/codemirror.js"></script>
<script src="../../lib/codemirror.js"></script>
<script src="sql.js"></script>
<style>
.CodeMirror {
......@@ -39,7 +38,7 @@ var init = function() {
<form>
<textarea id="code" name="code">-- SQL Mode for CodeMirror
SELECT SQL_NO_CACHE DISTINCT
@var1 AS `val1`, @'val2', @global.'sql_mode',
@var1 AS `val1`, @`val2`, @global.'sql_mode',
1.1 AS `float_val`, .14 AS `another_float`, 0.09e3 AS `int_with_esp`,
0xFA5 AS `hex`, x'fa5' AS `hex2`, 0b101 AS `bin`, b'101' AS `bin2`,
DATE '1994-01-01' AS `sql_date`, { T "1994-01-01" } AS `odbc_date`,
......
......@@ -55,7 +55,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
return "number";
}
// .table_name (ODBC)
if (stream.match(/^[a-zA-Z_]+/) && support.ODBCdotTable == true) {
if (support.ODBCdotTable == true && stream.match(/^[a-zA-Z_]+/)) {
return "variable-2";
}
} else if (operatorChars.test(ch)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment