rgviz 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rgviz/nodes.rb CHANGED
@@ -107,8 +107,8 @@ module Rgviz
107
107
 
108
108
  class Sort
109
109
 
110
- Asc = :asc
111
- Desc = :desc
110
+ Asc = Token::Asc
111
+ Desc = Token::Desc
112
112
 
113
113
  attr_accessor :column
114
114
  attr_accessor :order
@@ -214,19 +214,19 @@ module Rgviz
214
214
  end
215
215
 
216
216
  class BinaryExpression
217
- And = :and
218
- Contains = :contains
219
- EndsWith = :ends_with
220
- Eq = :EQ
221
- Gt = :GT
222
- Gte = :GTE
223
- Like = :like
224
- Lt = :LT
225
- Lte = :LTE
226
- Matches = :matches
227
- Neq = :NEQ
228
- Or = :or
229
- StartsWith = :starts_with
217
+ And = Token::And
218
+ Contains = Token::Contains
219
+ EndsWith = :'ends with'
220
+ Eq = Token::EQ
221
+ Gt = Token::GT
222
+ Gte = Token::GTE
223
+ Like = Token::Like
224
+ Lt = Token::LT
225
+ Lte = Token::LTE
226
+ Matches = Token::Matches
227
+ Neq = Token::NEQ
228
+ Or = Token::Or
229
+ StartsWith = :'starts with'
230
230
 
231
231
  attr_accessor :operator
232
232
  attr_accessor :left
@@ -252,9 +252,9 @@ module Rgviz
252
252
  end
253
253
 
254
254
  class UnaryExpression
255
- Not = :not
256
- IsNull = :is_null
257
- IsNotNull = :is_not_null
255
+ Not = Token::Not
256
+ IsNull = :'is null'
257
+ IsNotNull = :'is not null'
258
258
 
259
259
  attr_accessor :operand
260
260
  attr_accessor :operator
@@ -357,24 +357,24 @@ module Rgviz
357
357
 
358
358
  class ScalarFunctionColumn
359
359
 
360
- DateDiff = :datediff
361
- Day = :day
362
- DayOfWeek = :dayofweek
360
+ DateDiff = Token::DateDiff
361
+ Day = Token::Day
362
+ DayOfWeek = Token::DayOfWeek
363
363
  Difference = :difference
364
- Hour = :hour
365
- Lower = :lower
366
- Millisecond = :millisecond
367
- Minute = :minute
368
- Month = :month
369
- Now = :now
364
+ Hour = Token::Hour
365
+ Lower = Token::Lower
366
+ Millisecond = Token::Millisecond
367
+ Minute = Token::Minute
368
+ Month = Token::Month
369
+ Now = Token::Now
370
370
  Product = :product
371
- Quarter = :quarter
371
+ Quarter = Token::Quarter
372
372
  Quotient = :quotient
373
- Second = :second
373
+ Second = Token::Second
374
374
  Sum = :sum
375
- ToDate = :todate
376
- Upper = :upper
377
- Year = :year
375
+ ToDate = Token::ToDate
376
+ Upper = Token::Upper
377
+ Year = Token::Year
378
378
 
379
379
  attr_accessor :function
380
380
  attr_accessor :arguments
@@ -409,11 +409,11 @@ module Rgviz
409
409
 
410
410
  class AggregateColumn
411
411
 
412
- Avg = :avg
413
- Count = :count
414
- Max = :max
415
- Min = :min
416
- Sum = :sum
412
+ Avg = Token::Avg
413
+ Count = Token::Count
414
+ Max = Token::Max
415
+ Min = Token::Min
416
+ Sum = Token::Sum
417
417
 
418
418
  attr_accessor :function
419
419
  attr_accessor :argument
data/lib/rgviz/parser.rb CHANGED
@@ -239,7 +239,7 @@ module Rgviz
239
239
  raise ParseException.new "Expecting right exp" unless right
240
240
  return BinaryExpression.new left, operator, right
241
241
  when Token::Starts, Token::Ends
242
- operator = "#{@token.value}_with".to_sym
242
+ operator = "#{@token.value} with".to_sym
243
243
  next_token
244
244
  check! Token::With
245
245
  right = parse_column
data/lib/rgviz/token.rb CHANGED
@@ -58,22 +58,22 @@ module Rgviz
58
58
  DECIMAL = :DECIMAL
59
59
  STRING = :STRING
60
60
 
61
- PLUS = :PLUS
62
- MINUS = :MINUS
63
- STAR = :STAR
64
- SLASH = :SLASH
61
+ PLUS = :'+'
62
+ MINUS = :'-'
63
+ STAR = :'*'
64
+ SLASH = :'/'
65
65
 
66
- COMMA = :COMMA
67
- LPAREN = :LPAREN
68
- RPAREN = :RPAREN
69
- EQ = :EQ
70
- LT = :LT
71
- LTE = :LTE
72
- GT = :GT
73
- GTE = :GTE
74
- NEQ = :NEQ
66
+ COMMA = :','
67
+ LPAREN = :'('
68
+ RPAREN = :')'
69
+ EQ = :'='
70
+ LT = :'<'
71
+ LTE = :'<='
72
+ GT = :'>'
73
+ GTE = :'>='
74
+ NEQ = :'!='
75
75
 
76
- EOF = :EOF
76
+ EOF = :'<EOF'
77
77
 
78
78
  attr_accessor :start
79
79
  attr_accessor :value
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: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 4
9
- version: "0.4"
8
+ - 5
9
+ version: "0.5"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ary Borenszweig