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

Commit

Permalink
do not show parenthesis in error message for syntax error when there …
Browse files Browse the repository at this point in the history
…is nothing to put inside them. fixes for css in demo. refs #2
  • Loading branch information
nwronski committed Jul 2, 2015
1 parent 152d831 commit dee97f3
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
14 changes: 8 additions & 6 deletions demo/css/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ body {
}

footer, header {
padding: 8px;
color: #dbdbdb;
padding: 0;
}

footer h3, header h2 {
Expand All @@ -87,16 +87,18 @@ footer h3, header h2 {
footer h3 {
margin: 0 auto;
text-align: center;
line-height: 24px;
font-size: 16px;
}

footer a, footer a:visited {
color: #2f6a9e;
a, a:visited {
color: #e6db74;
text-decoration: none;
}

footer a:hover, footer a:active {
color: #329e2f;
text-decoration: underline;
a:hover, a:active {
color: #77A025;
text-decoration: none;

}

Expand Down
4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<body>
<header>
<h2>sqlite-parser demo</h2>
<h2><a title="sqlite-parser on GitHub" href="https://github.com/codeschool/sqlite-parser/">sqlite-parser</a> demo</h2>
</header>

<div class="container">
Expand Down Expand Up @@ -50,7 +50,7 @@ <h3 id="ast-header">Syntax Tree</h3>

<footer>
<h3>
<a title="sqlite-parser" href="https://github.com/codeschool/sqlite-parser/">sqlite-parser</a>
<a title="sqlite-parser on GitHub" href="https://github.com/codeschool/sqlite-parser/">sqlite-parser</a>
&lt; <a title="Nick Wronski" href="mailto:[email protected]">[email protected]</a> &gt;
</h3>
<h3>
Expand Down
2 changes: 1 addition & 1 deletion demo/sqlite-parser-demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28814,7 +28814,7 @@ module.exports = (function (_) {
// Don't accidentally repeat the first description in the output
chainDetail = _(chain).rest().takeRight(2).value();
message = 'Syntax error found near ' + _.first(chain) +
' (' + chainDetail.join(', ') + ')' + '';
(chainDetail.length > 0 ? ' (' + chainDetail.join(', ') + ')' : '');
location = _.findLast(this.events, {description: _.last(chain)}).location;
throw {
'name': 'SyntaxError',
Expand Down
2 changes: 1 addition & 1 deletion dist/sqlite-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -28744,7 +28744,7 @@ module.exports = (function (_) {
// Don't accidentally repeat the first description in the output
chainDetail = _(chain).rest().takeRight(2).value();
message = 'Syntax error found near ' + _.first(chain) +
' (' + chainDetail.join(', ') + ')' + '';
(chainDetail.length > 0 ? ' (' + chainDetail.join(', ') + ')' : '');
location = _.findLast(this.events, {description: _.last(chain)}).location;
throw {
'name': 'SyntaxError',
Expand Down
2 changes: 1 addition & 1 deletion lib/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = (function (_) {
// Don't accidentally repeat the first description in the output
chainDetail = _(chain).rest().takeRight(2).value();
message = 'Syntax error found near ' + _.first(chain) +
' (' + chainDetail.join(', ') + ')' + '';
(chainDetail.length > 0 ? ' (' + chainDetail.join(', ') + ')' : '');
location = _.findLast(this.events, {description: _.last(chain)}).location;
throw {
'name': 'SyntaxError',
Expand Down
2 changes: 1 addition & 1 deletion src/tracer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = (function (_) {
// Don't accidentally repeat the first description in the output
chainDetail = _(chain).rest().takeRight(2).value();
message = 'Syntax error found near ' + _.first(chain) +
' (' + chainDetail.join(', ') + ')' + '';
(chainDetail.length > 0 ? ' (' + chainDetail.join(', ') + ')' : '');
location = _.findLast(this.events, {description: _.last(chain)}).location;
throw {
'name': 'SyntaxError',
Expand Down

0 comments on commit dee97f3

Please sign in to comment.