Skip to content

Commit 9bb81e5

Browse files
authored
Merge pull request #24 from komali2/master
Change "refrence" to "reference" in all instances
2 parents ff9b7ce + 499bc18 commit 9bb81e5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/sqlParser.jison

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[-][-]\s.*\n /* skip sql comments */
1111
[#]\s.*\n /* skip sql comments */
1212
\s+ /* skip whitespace */
13-
13+
1414
[`][a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*[`] return 'IDENTIFIER'
1515
[\w]+[\u4e00-\u9fa5]+[0-9a-zA-Z_\u4e00-\u9fa5]* return 'IDENTIFIER'
1616
[\u4e00-\u9fa5][0-9a-zA-Z_\u4e00-\u9fa5]* return 'IDENTIFIER'
@@ -117,7 +117,7 @@ UNION return 'UNION'
117117
"{" return '{'
118118
"}" return '}'
119119
";" return ';'
120-
120+
121121
['](\\.|[^'])*['] return 'STRING'
122122
["](\\.|[^"])*["] return 'STRING'
123123
[0][x][0-9a-fA-F]+ return 'HEX_NUMERIC'
@@ -127,7 +127,7 @@ UNION return 'UNION'
127127
[a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]* return 'IDENTIFIER'
128128
\. return 'DOT'
129129
['"][a-zA-Z_\u4e00-\u9fa5][a-zA-Z0-9_\u4e00-\u9fa5]*["'] return 'QUOTED_IDENTIFIER'
130-
130+
131131
<<EOF>> return 'EOF'
132132
. return 'INVALID'
133133

@@ -189,7 +189,7 @@ unionClauseNotParenthesized
189189
;
190190

191191
selectClause
192-
: SELECT
192+
: SELECT
193193
distinctOpt
194194
highPriorityOpt
195195
maxStateMentTimeOpt
@@ -228,7 +228,7 @@ selectClause
228228
;
229229

230230
distinctOpt
231-
: ALL { $$ = $1 }
231+
: ALL { $$ = $1 }
232232
| DISTINCT { $$ = $1 }
233233
| DISTINCTROW { $$ = $1 }
234234
| { $$ = null }
@@ -361,7 +361,7 @@ simple_expr
361361
;
362362
bit_expr
363363
: simple_expr { $$ = $1 }
364-
| bit_expr '|' bit_expr { $$ = { type: 'BitExpression', operator: '|', left: $1, right: $3 } }
364+
| bit_expr '|' bit_expr { $$ = { type: 'BitExpression', operator: '|', left: $1, right: $3 } }
365365
| bit_expr '&' bit_expr { $$ = { type: 'BitExpression', operator: '&', left: $1, right: $3 } }
366366
| bit_expr '<<' bit_expr { $$ = { type: 'BitExpression', operator: '<<', left: $1, right: $3 } }
367367
| bit_expr '>>' bit_expr { $$ = { type: 'BitExpression', operator: '>>', left: $1, right: $3 } }
@@ -494,12 +494,12 @@ selectDataSetOpt
494494
{ $$ = { from: $2, partition: $3, where: $4, groupBy: $5, having: $6, orderBy: $7, limit: $8, procedure: $9, updateLockMode: $10 } }
495495
;
496496
table_refrences
497-
: escaped_table_reference { $$ = { type: 'TableRefrences', value: [ $1 ] } }
497+
: escaped_table_reference { $$ = { type: 'TableReferences', value: [ $1 ] } }
498498
| table_refrences ',' escaped_table_reference %prec TABLE_REF_COMMA { $$ = $1; $1.value.push($3); }
499499
;
500500
escaped_table_reference
501-
: table_reference { $$ = { type: 'TableRefrence', value: $1 } }
502-
| '{' OJ table_reference '}' { $$ = { type: 'TableRefrence', hasOj: true, value: $3 } }
501+
: table_reference { $$ = { type: 'TableReference', value: $1 } }
502+
| '{' OJ table_reference '}' { $$ = { type: 'TableReference', hasOj: true, value: $3 } }
503503
;
504504
join_inner_cross
505505
: { $$ = null }

src/stringify.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ Sql.prototype.travelLimit = function (ast) {
387387
}
388388
}
389389
}
390-
Sql.prototype.travelTableRefrences = function (ast) {
390+
Sql.prototype.travelTableReferences = function (ast) {
391391
var list = ast.value;
392-
if (ast.TableRefrences) {
392+
if (ast.TableReferences) {
393393
this.append('(', false, true);
394394
}
395395
for (var i = 0; i < list.length; i++) {
@@ -398,11 +398,11 @@ Sql.prototype.travelTableRefrences = function (ast) {
398398
this.append(',', true);
399399
}
400400
}
401-
if (ast.TableRefrences) {
401+
if (ast.TableReferences) {
402402
this.append(')');
403403
}
404404
}
405-
Sql.prototype.travelTableRefrence = function (ast) {
405+
Sql.prototype.travelTableReference = function (ast) {
406406
if (ast.hasOj) {
407407
this.append('{');
408408
this.appendKeyword('oj');

0 commit comments

Comments
 (0)