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 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! when 't', 'T'
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
@@ -384,6 +384,7 @@ module Rgviz
384
384
 
385
385
  class ScalarFunctionColumn
386
386
 
387
+ Concat = Token::Concat
387
388
  DateDiff = Token::DateDiff
388
389
  Day = Token::Day
389
390
  DayOfWeek = Token::DayOfWeek
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
@@ -5,6 +5,7 @@ module Rgviz
5
5
  Asc = :asc
6
6
  Avg = :avg
7
7
  By = :by
8
+ Concat = :concat
8
9
  Contains = :contains
9
10
  Count = :count
10
11
  Desc = :desc
@@ -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
@@ -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: 77
4
+ hash: 67
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 35
9
- version: "0.35"
8
+ - 36
9
+ version: "0.36"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ary Borenszweig