rgviz 0.35 → 0.36
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rgviz/lexer.rb +8 -1
- data/lib/rgviz/nodes.rb +1 -0
- data/lib/rgviz/parser.rb +1 -1
- data/lib/rgviz/token.rb +1 -0
- data/spec/rgviz/lexer_spec.rb +1 -0
- data/spec/rgviz/parser_spec.rb +2 -1
- metadata +3 -3
data/lib/rgviz/lexer.rb
CHANGED
@@ -118,7 +118,14 @@ module Rgviz
|
|
118
118
|
case c! when 'o', 'O'
|
119
119
|
case c!
|
120
120
|
when 'n', 'N'
|
121
|
-
case c!
|
121
|
+
case c!
|
122
|
+
when 'c', 'C'
|
123
|
+
case c! when 'a', 'A'
|
124
|
+
case c! when 't', 'T'
|
125
|
+
return keyword(Token::Concat) if end_of_identifier!
|
126
|
+
end
|
127
|
+
end
|
128
|
+
when 't', 'T'
|
122
129
|
case c! when 'a', 'A'
|
123
130
|
case c! when 'i', 'I'
|
124
131
|
case c! when 'n', 'N'
|
data/lib/rgviz/nodes.rb
CHANGED
data/lib/rgviz/parser.rb
CHANGED
@@ -383,7 +383,7 @@ module Rgviz
|
|
383
383
|
when Token::Year, Token::Month, Token::Day,
|
384
384
|
Token::Hour, Token::Minute, Token::Second, Token::Millisecond,
|
385
385
|
Token::Now, Token::DateDiff, Token::Lower, Token::Upper,
|
386
|
-
Token::Quarter, Token::DayOfWeek, Token::ToDate
|
386
|
+
Token::Quarter, Token::DayOfWeek, Token::ToDate, Token::Concat
|
387
387
|
function = @token.value
|
388
388
|
string = @token.string
|
389
389
|
next_token
|
data/lib/rgviz/token.rb
CHANGED
data/spec/rgviz/lexer_spec.rb
CHANGED
@@ -83,6 +83,7 @@ describe Lexer do
|
|
83
83
|
it_lexes_keyword 'asc', Token::Asc
|
84
84
|
it_lexes_keyword 'avg', Token::Avg
|
85
85
|
it_lexes_keyword 'by', Token::By
|
86
|
+
it_lexes_keyword 'concat', Token::Concat
|
86
87
|
it_lexes_keyword 'contains', Token::Contains
|
87
88
|
it_lexes_keyword 'count', Token::Count
|
88
89
|
it_lexes_keyword 'date', Token::Date
|
data/spec/rgviz/parser_spec.rb
CHANGED
@@ -199,7 +199,8 @@ describe Parser do
|
|
199
199
|
['upper', ScalarFunctionColumn::Upper],
|
200
200
|
['quarter', ScalarFunctionColumn::Quarter],
|
201
201
|
['dayofweek', ScalarFunctionColumn::DayOfWeek],
|
202
|
-
['todate', ScalarFunctionColumn::ToDate]
|
202
|
+
['todate', ScalarFunctionColumn::ToDate],
|
203
|
+
['concat', ScalarFunctionColumn::Concat],
|
203
204
|
].each do |str, function|
|
204
205
|
it "parses #{str} function" do
|
205
206
|
col = parse_select_single_column "#{str}(col)"
|
metadata
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rgviz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 67
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: "0.
|
8
|
+
- 36
|
9
|
+
version: "0.36"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ary Borenszweig
|