File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 77
77
, { [:comma, text] }
78
78
79
79
# identifier
80
+ `{IDENT}` { [:identifier, text[1..-2]] }
80
81
{IDENT} { [:identifier, text] }
81
82
82
83
---- header ----
Original file line number Diff line number Diff line change @@ -203,6 +203,9 @@ def scan_evaluate( str )
203
203
when ( text = ss . scan ( /,/ ) )
204
204
@rex_tokens . push action { [ :comma , text ] }
205
205
206
+ when ( text = ss . scan ( /`\w +`/ ) )
207
+ @rex_tokens . push action { [ :identifier , text [ 1 ..-2 ] ] }
208
+
206
209
when ( text = ss . scan ( /\w +/ ) )
207
210
@rex_tokens . push action { [ :identifier , text ] }
208
211
Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ def test_numeric_value_expression
193
193
assert_understands 'SELECT (1 - 2)'
194
194
end
195
195
196
+ def test_quoted_identifier
197
+ assert_sql 'SELECT a' , 'SELECT `a`'
198
+ end
199
+
196
200
def test_date
197
201
assert_sql "SELECT DATE '2008-07-11'" , 'SELECT DATE "2008-07-11"'
198
202
assert_understands "SELECT DATE '2008-07-11'"
You can’t perform that action at this time.
0 commit comments