Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Commit

Permalink
fixed error reporting when there is more than one statement in the in…
Browse files Browse the repository at this point in the history
…put SQL. still need to make sure previous tree is not used if a following statement has an error at the highest level. some css improvements to the interactive demo, additional names in grammar.pegjs. need to fork pegjs to get the changes to pegjs core into version control so they are not accidentally overwritten. refs #2
  • Loading branch information
nwronski committed Jul 3, 2015
1 parent dee97f3 commit dd715f9
Show file tree
Hide file tree
Showing 12 changed files with 9,561 additions and 10,559 deletions.
3 changes: 2 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ module.exports = function(grunt) {
demo: {
options: {
alias: {
'sqlite-parser': './index.js',
'sqlite-parser': './index',
'sqlite-parser-util': './lib/parser-util',
'codemirror': './node_modules/codemirror/lib/codemirror',
'foldcode': './node_modules/codemirror/addon/fold/foldcode',
'foldgutter': './node_modules/codemirror/addon/fold/foldgutter',
Expand Down
4 changes: 3 additions & 1 deletion demo/css/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ body {

.right {
border: 1px solid #77A025;
transition: all 0.75s;
}

.right.alert {
Expand All @@ -60,6 +61,7 @@ body {
background-color: #daf6a1;
color: #557B0A;
border-bottom: 1px solid #77A025;
transition: all 0.75s;
}

.container .right.alert h3 {
Expand Down Expand Up @@ -97,7 +99,7 @@ a, a:visited {
}

a:hover, a:active {
color: #77A025;
color: #FFF7A8;
text-decoration: none;

}
Expand Down
28 changes: 14 additions & 14 deletions demo/js/demo.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
(function (root) {
var sqliteParser = require('sqlite-parser'),
util = require('sqlite-parser-util'),
CodeMirror = require('codemirror'),
panel = document.getElementById('ast'),
msgArea = document.getElementById('ast-header');
msgArea = document.getElementById('ast-header'),
elemSql = document.getElementById('sql-text'),
elemAst = document.getElementById('ast-text');

require('foldcode');
require('foldgutter');
Expand Down Expand Up @@ -67,24 +70,21 @@
}

var loadDemo = function () {
var sql = CodeMirror.fromTextArea(document.getElementById('sql-text'), {
mode: 'text/x-plsql',
var cmDefaults = {
lineNumbers: true,
theme: 'monokai',
tabSize: 4,
lineWrapping: true,
lineWrapping: true
}),
ast = CodeMirror.fromTextArea(document.getElementById('ast-text'), {
lineNumbers: true,
theme: 'monokai',
lineWrapping: true,
mode: "application/ld+json",
tabSize: 4,
lineWrapping: true,
foldGutter: true,
gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
}),
},
sql = CodeMirror.fromTextArea(elemSql, util.extend({
mode: 'text/x-plsql'
}, cmDefaults)),
ast = CodeMirror.fromTextArea(elemAst, util.extend({
mode: "application/ld+json",
foldGutter: true,
readOnly: 'nocursor'
}, cmDefaults)),
update = debounce(function () {
updater(sql, ast);
}, 250);
Expand Down
Loading

0 comments on commit dd715f9

Please sign in to comment.