rgviz 0.21 → 0.22
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rgviz/lexer.rb +2 -2
- data/lib/rgviz/parser.rb +5 -3
- metadata +3 -3
data/lib/rgviz/lexer.rb
CHANGED
@@ -593,13 +593,13 @@ module Rgviz
|
|
593
593
|
|
594
594
|
def keyword(value)
|
595
595
|
@token.value = value
|
596
|
+
@token.string = @str[@token.start ... @p].join
|
596
597
|
@token
|
597
598
|
end
|
598
599
|
|
599
600
|
def keyword!(value)
|
600
601
|
@p += 1
|
601
|
-
|
602
|
-
@token
|
602
|
+
keyword value
|
603
603
|
end
|
604
604
|
end
|
605
605
|
end
|
data/lib/rgviz/parser.rb
CHANGED
@@ -311,7 +311,7 @@ module Rgviz
|
|
311
311
|
when Token::Contains, Token::Starts, Token::Ends, Token::With,
|
312
312
|
Token::Matches, Token::Like, Token::NoValues, Token::NoFormat,
|
313
313
|
Token::Is, Token::Null
|
314
|
-
return value_column(IdColumn.new @token.
|
314
|
+
return value_column(IdColumn.new @token.string)
|
315
315
|
when Token::PLUS
|
316
316
|
next_token
|
317
317
|
check Token::INTEGER, Token::DECIMAL
|
@@ -347,26 +347,28 @@ module Rgviz
|
|
347
347
|
return value_column(TimeOfDayColumn.new Time.parse(@token.string))
|
348
348
|
when Token::Avg, Token::Count, Token::Min, Token::Max, Token::Sum
|
349
349
|
function = @token.value
|
350
|
+
string = @token.string
|
350
351
|
next_token
|
351
352
|
if token_is! Token::LPAREN
|
352
353
|
column = parse_column
|
353
354
|
check! Token::RPAREN
|
354
355
|
return AggregateColumn.new function, column
|
355
356
|
else
|
356
|
-
return IdColumn.new
|
357
|
+
return IdColumn.new string
|
357
358
|
end
|
358
359
|
when Token::Year, Token::Month, Token::Day,
|
359
360
|
Token::Hour, Token::Minute, Token::Second, Token::Millisecond,
|
360
361
|
Token::Now, Token::DateDiff, Token::Lower, Token::Upper,
|
361
362
|
Token::Quarter, Token::DayOfWeek, Token::ToDate
|
362
363
|
function = @token.value
|
364
|
+
string = @token.string
|
363
365
|
next_token
|
364
366
|
if token_is! Token::LPAREN
|
365
367
|
columns = parse_columns
|
366
368
|
check! Token::RPAREN
|
367
369
|
return ScalarFunctionColumn.new function, *columns
|
368
370
|
else
|
369
|
-
return IdColumn.new
|
371
|
+
return IdColumn.new string
|
370
372
|
end
|
371
373
|
end
|
372
374
|
nil
|
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: 39
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: "0.
|
8
|
+
- 22
|
9
|
+
version: "0.22"
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ary Borenszweig
|