rgviz 0.31 → 0.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/rgviz/lexer.rb +63 -63
  2. data/lib/rgviz/parser.rb +24 -24
  3. metadata +3 -3
data/lib/rgviz/lexer.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Rgviz
2
2
  class Lexer
3
3
  def initialize(str)
4
- @str = (str || '').chars.to_a
4
+ @str = (str || '').scan(/./)
5
5
  @len = @str.length
6
6
  @token = Token.new
7
7
  @p = 0
@@ -23,7 +23,7 @@ module Rgviz
23
23
  ending = c
24
24
  while c! != ending && c != nil
25
25
  end
26
- raise ParseException.new "Unmatched #{char}" if c != ending
26
+ raise ParseException.new("Unmatched #{char}") if c != ending
27
27
  @p += 1
28
28
  @token.value = ending == '`' ? Token::ID : Token::STRING
29
29
  @token.string = @str[@token.start + 1 ... @p - 1].join
@@ -62,16 +62,16 @@ module Rgviz
62
62
  @token.value = Token::DECIMAL
63
63
  @token.number = @str[@token.start ... @p].join.to_f
64
64
  return @token
65
- when '+'; return keyword! Token::PLUS
66
- when '-'; return keyword! Token::MINUS
67
- when '*'; return keyword! Token::STAR
68
- when '/'; return keyword! Token::SLASH
69
- when ','; return keyword! Token::COMMA
70
- when '('; return keyword! Token::LPAREN
71
- when ')'; return keyword! Token::RPAREN
72
- when '='; return keyword! Token::EQ
65
+ when '+'; return keyword!(Token::PLUS)
66
+ when '-'; return keyword!(Token::MINUS)
67
+ when '*'; return keyword!(Token::STAR)
68
+ when '/'; return keyword!(Token::SLASH)
69
+ when ','; return keyword!(Token::COMMA)
70
+ when '('; return keyword!(Token::LPAREN)
71
+ when ')'; return keyword!(Token::RPAREN)
72
+ when '='; return keyword!(Token::EQ)
73
73
  when '!';
74
- raise ParseException.new "Unexpected character '!'" if c! != '='
74
+ raise ParseException.new("Unexpected character '!'") if c! != '='
75
75
  return keyword! Token::NEQ
76
76
  when '<';
77
77
  case c!
@@ -99,20 +99,20 @@ module Rgviz
99
99
  case c!
100
100
  when 'n', 'N'
101
101
  case c! when 'd', 'D'
102
- return keyword Token::And if end_of_identifier!
102
+ return keyword(Token::And) if end_of_identifier!
103
103
  end
104
104
  when 's', 'S'
105
105
  case c! when 'c', 'C'
106
- return keyword Token::Asc if end_of_identifier!
106
+ return keyword(Token::Asc) if end_of_identifier!
107
107
  end
108
108
  when 'v', 'V'
109
109
  case c! when 'g', 'G'
110
- return keyword Token::Avg if end_of_identifier!
110
+ return keyword(Token::Avg) if end_of_identifier!
111
111
  end
112
112
  end
113
113
  when 'b', 'B'
114
114
  case c! when 'y', 'Y'
115
- return keyword Token::By if end_of_identifier!
115
+ return keyword(Token::By) if end_of_identifier!
116
116
  end
117
117
  when 'c', 'C'
118
118
  case c! when 'o', 'O'
@@ -123,7 +123,7 @@ module Rgviz
123
123
  case c! when 'i', 'I'
124
124
  case c! when 'n', 'N'
125
125
  case c! when 's', 'S'
126
- return keyword Token::Contains if end_of_identifier!
126
+ return keyword(Token::Contains) if end_of_identifier!
127
127
  end
128
128
  end
129
129
  end
@@ -132,7 +132,7 @@ module Rgviz
132
132
  when 'u', 'U'
133
133
  case c! when 'n', 'N'
134
134
  case c! when 't', 'T'
135
- return keyword Token::Count if end_of_identifier!
135
+ return keyword(Token::Count) if end_of_identifier!
136
136
  end
137
137
  end
138
138
  end
@@ -143,13 +143,13 @@ module Rgviz
143
143
  case c!
144
144
  when 't', 'T'
145
145
  case c! when 'e', 'E'
146
- return keyword Token::Date if end_of_identifier!
146
+ return keyword(Token::Date) if end_of_identifier!
147
147
  case c
148
148
  when 'd', 'D'
149
149
  case c! when 'i', 'I'
150
150
  case c! when 'f', 'F'
151
151
  case c! when 'f', 'F'
152
- return keyword Token::DateDiff if end_of_identifier!
152
+ return keyword(Token::DateDiff) if end_of_identifier!
153
153
  end
154
154
  end
155
155
  end
@@ -157,21 +157,21 @@ module Rgviz
157
157
  case c! when 'i', 'I'
158
158
  case c! when 'm', 'M'
159
159
  case c! when 'e', 'E'
160
- return keyword Token::DateTime if end_of_identifier!
160
+ return keyword(Token::DateTime) if end_of_identifier!
161
161
  end
162
162
  end
163
163
  end
164
164
  end
165
165
  end
166
166
  when 'y', 'Y'
167
- return keyword Token::Day if end_of_identifier!
167
+ return keyword(Token::Day) if end_of_identifier!
168
168
  case c when 'o', 'O'
169
169
  case c! when 'f', 'F'
170
170
  case c! when 'w', 'W'
171
171
  case c! when 'e', 'E'
172
172
  case c! when 'e', 'E'
173
173
  case c! when 'k', 'K'
174
- return keyword Token::DayOfWeek if end_of_identifier!
174
+ return keyword(Token::DayOfWeek) if end_of_identifier!
175
175
  end
176
176
  end
177
177
  end
@@ -182,7 +182,7 @@ module Rgviz
182
182
  when 'e', 'E'
183
183
  case c! when 's', 'S'
184
184
  case c! when 'c', 'C'
185
- return keyword Token::Desc if end_of_identifier!
185
+ return keyword(Token::Desc) if end_of_identifier!
186
186
  end
187
187
  end
188
188
  end
@@ -190,7 +190,7 @@ module Rgviz
190
190
  case c! when 'n', 'N'
191
191
  case c! when 'd', 'D'
192
192
  case c! when 's', 'S'
193
- return keyword Token::Ends if end_of_identifier!
193
+ return keyword(Token::Ends) if end_of_identifier!
194
194
  end
195
195
  end
196
196
  end
@@ -200,7 +200,7 @@ module Rgviz
200
200
  case c! when 'l', 'L'
201
201
  case c! when 's', 'S'
202
202
  case c! when 'e', 'E'
203
- return keyword Token::False if end_of_identifier!
203
+ return keyword(Token::False) if end_of_identifier!
204
204
  end
205
205
  end
206
206
  end
@@ -209,7 +209,7 @@ module Rgviz
209
209
  case c! when 'm', 'M'
210
210
  case c! when 'a', 'A'
211
211
  case c! when 't', 'T'
212
- return keyword Token::Format if end_of_identifier!
212
+ return keyword(Token::Format) if end_of_identifier!
213
213
  end
214
214
  end
215
215
  end
@@ -220,7 +220,7 @@ module Rgviz
220
220
  case c! when 'o', 'O'
221
221
  case c! when 'u', 'U'
222
222
  case c! when 'p', 'P'
223
- return keyword Token::Group if end_of_identifier!
223
+ return keyword(Token::Group) if end_of_identifier!
224
224
  end
225
225
  end
226
226
  end
@@ -229,13 +229,13 @@ module Rgviz
229
229
  case c! when 'o', 'O'
230
230
  case c! when 'u', 'U'
231
231
  case c! when 'r', 'R'
232
- return keyword Token::Hour if end_of_identifier!
232
+ return keyword(Token::Hour) if end_of_identifier!
233
233
  end
234
234
  end
235
235
  end
236
236
  when 'i', 'I'
237
237
  case c! when 's', 'S'
238
- return keyword Token::Is if end_of_identifier!
238
+ return keyword(Token::Is) if end_of_identifier!
239
239
  end
240
240
  when 'l', 'L'
241
241
  case c!
@@ -243,7 +243,7 @@ module Rgviz
243
243
  case c! when 'b', 'B'
244
244
  case c! when 'e', 'E'
245
245
  case c! when 'l', 'L'
246
- return keyword Token::Label if end_of_identifier!
246
+ return keyword(Token::Label) if end_of_identifier!
247
247
  end
248
248
  end
249
249
  end
@@ -251,12 +251,12 @@ module Rgviz
251
251
  case c!
252
252
  when 'k', 'K'
253
253
  case c! when 'e', 'E'
254
- return keyword Token::Like if end_of_identifier!
254
+ return keyword(Token::Like) if end_of_identifier!
255
255
  end
256
256
  when 'm', 'M'
257
257
  case c! when 'i', 'I'
258
258
  case c! when 't', 'T'
259
- return keyword Token::Limit if end_of_identifier!
259
+ return keyword(Token::Limit) if end_of_identifier!
260
260
  end
261
261
  end
262
262
  end
@@ -264,7 +264,7 @@ module Rgviz
264
264
  case c! when 'w', 'W'
265
265
  case c! when 'e', 'E'
266
266
  case c! when 'r', 'R'
267
- return keyword Token::Lower if end_of_identifier!
267
+ return keyword(Token::Lower) if end_of_identifier!
268
268
  end
269
269
  end
270
270
  end
@@ -278,13 +278,13 @@ module Rgviz
278
278
  case c! when 'h', 'H'
279
279
  case c! when 'e', 'E'
280
280
  case c! when 's', 'S'
281
- return keyword Token::Matches if end_of_identifier!
281
+ return keyword(Token::Matches) if end_of_identifier!
282
282
  end
283
283
  end
284
284
  end
285
285
  end
286
286
  when 'x', 'X'
287
- return keyword Token::Max if end_of_identifier!
287
+ return keyword(Token::Max) if end_of_identifier!
288
288
  end
289
289
  when 'i', 'I'
290
290
  case c! when 'l', 'L'
@@ -296,7 +296,7 @@ module Rgviz
296
296
  case c! when 'o', 'O'
297
297
  case c! when 'n', 'N'
298
298
  case c! when 'd', 'D'
299
- return keyword Token::Millisecond if end_of_identifier!
299
+ return keyword(Token::Millisecond) if end_of_identifier!
300
300
  end
301
301
  end
302
302
  end
@@ -306,11 +306,11 @@ module Rgviz
306
306
  end
307
307
  end
308
308
  when 'n', 'N'
309
- return keyword Token::Min if end_of_identifier!
309
+ return keyword(Token::Min) if end_of_identifier!
310
310
  case c when 'u', 'U'
311
311
  case c! when 't', 'T'
312
312
  case c! when 'e', 'E'
313
- return keyword Token::Minute if end_of_identifier!
313
+ return keyword(Token::Minute) if end_of_identifier!
314
314
  end
315
315
  end
316
316
  end
@@ -319,7 +319,7 @@ module Rgviz
319
319
  case c! when 'n', 'N'
320
320
  case c! when 't', 'T'
321
321
  case c! when 'h', 'H'
322
- return keyword Token::Month if end_of_identifier!
322
+ return keyword(Token::Month) if end_of_identifier!
323
323
  end
324
324
  end
325
325
  end
@@ -329,9 +329,9 @@ module Rgviz
329
329
  when 'o', 'O'
330
330
  case c!
331
331
  when 't', 'T'
332
- return keyword Token::Not if end_of_identifier!
332
+ return keyword(Token::Not) if end_of_identifier!
333
333
  when 'w', 'W'
334
- return keyword Token::Now if end_of_identifier!
334
+ return keyword(Token::Now) if end_of_identifier!
335
335
  when '_'
336
336
  case c!
337
337
  when 'f', 'F'
@@ -340,7 +340,7 @@ module Rgviz
340
340
  case c! when 'm', 'M'
341
341
  case c! when 'a', 'A'
342
342
  case c! when 't', 'T'
343
- return keyword Token::NoFormat if end_of_identifier!
343
+ return keyword(Token::NoFormat) if end_of_identifier!
344
344
  end
345
345
  end
346
346
  end
@@ -352,7 +352,7 @@ module Rgviz
352
352
  case c! when 'u', 'U'
353
353
  case c! when 'e', 'E'
354
354
  case c! when 's', 'S'
355
- return keyword Token::NoValues if end_of_identifier!
355
+ return keyword(Token::NoValues) if end_of_identifier!
356
356
  end
357
357
  end
358
358
  end
@@ -363,7 +363,7 @@ module Rgviz
363
363
  when 'u', 'U'
364
364
  case c! when 'l', 'L'
365
365
  case c! when 'l', 'L'
366
- return keyword Token::Null if end_of_identifier!
366
+ return keyword(Token::Null) if end_of_identifier!
367
367
  end
368
368
  end
369
369
  end
@@ -374,7 +374,7 @@ module Rgviz
374
374
  case c! when 's', 'S'
375
375
  case c! when 'e', 'E'
376
376
  case c! when 't', 'T'
377
- return keyword Token::Offset if end_of_identifier!
377
+ return keyword(Token::Offset) if end_of_identifier!
378
378
  end
379
379
  end
380
380
  end
@@ -385,18 +385,18 @@ module Rgviz
385
385
  case c! when 'o', 'O'
386
386
  case c! when 'n', 'N'
387
387
  case c! when 's', 'S'
388
- return keyword Token::Options if end_of_identifier!
388
+ return keyword(Token::Options) if end_of_identifier!
389
389
  end
390
390
  end
391
391
  end
392
392
  end
393
393
  end
394
394
  when 'r', 'R'
395
- return keyword Token::Or if end_of_identifier!
395
+ return keyword(Token::Or) if end_of_identifier!
396
396
  case c when 'd', 'D'
397
397
  case c! when 'e', 'E'
398
398
  case c! when 'r', 'R'
399
- return keyword Token::Order if end_of_identifier!
399
+ return keyword(Token::Order) if end_of_identifier!
400
400
  end
401
401
  end
402
402
  end
@@ -406,7 +406,7 @@ module Rgviz
406
406
  case c! when 'v', 'V'
407
407
  case c! when 'o', 'O'
408
408
  case c! when 't', 'T'
409
- return keyword Token::Pivot if end_of_identifier!
409
+ return keyword(Token::Pivot) if end_of_identifier!
410
410
  end
411
411
  end
412
412
  end
@@ -418,7 +418,7 @@ module Rgviz
418
418
  case c! when 't', 'T'
419
419
  case c! when 'e', 'E'
420
420
  case c! when 'r', 'R'
421
- return keyword Token::Quarter if end_of_identifier!
421
+ return keyword(Token::Quarter) if end_of_identifier!
422
422
  end
423
423
  end
424
424
  end
@@ -433,7 +433,7 @@ module Rgviz
433
433
  case c! when 'o', 'O'
434
434
  case c! when 'n', 'N'
435
435
  case c! when 'd', 'D'
436
- return keyword Token::Second if end_of_identifier!
436
+ return keyword(Token::Second) if end_of_identifier!
437
437
  end
438
438
  end
439
439
  end
@@ -441,7 +441,7 @@ module Rgviz
441
441
  case c! when 'e', 'E'
442
442
  case c! when 'c', 'C'
443
443
  case c! when 't', 'T'
444
- return keyword Token::Select if end_of_identifier!
444
+ return keyword(Token::Select) if end_of_identifier!
445
445
  end
446
446
  end
447
447
  end
@@ -451,14 +451,14 @@ module Rgviz
451
451
  case c! when 'r', 'R'
452
452
  case c! when 't', 'T'
453
453
  case c! when 's', 'S'
454
- return keyword Token::Starts if end_of_identifier!
454
+ return keyword(Token::Starts) if end_of_identifier!
455
455
  end
456
456
  end
457
457
  end
458
458
  end
459
459
  when 'u', 'U'
460
460
  case c! when 'm', 'M'
461
- return keyword Token::Sum if end_of_identifier!
461
+ return keyword(Token::Sum) if end_of_identifier!
462
462
  end
463
463
  end
464
464
  when 't', 'T'
@@ -472,7 +472,7 @@ module Rgviz
472
472
  case c! when 'd', 'D'
473
473
  case c! when 'a', 'A'
474
474
  case c! when 'y', 'Y'
475
- return keyword Token::TimeOfDay if end_of_identifier!
475
+ return keyword(Token::TimeOfDay) if end_of_identifier!
476
476
  end
477
477
  end
478
478
  end
@@ -482,7 +482,7 @@ module Rgviz
482
482
  case c! when 'a', 'A'
483
483
  case c! when 'm', 'M'
484
484
  case c! when 'p', 'P'
485
- return keyword Token::Timestamp if end_of_identifier!
485
+ return keyword(Token::Timestamp) if end_of_identifier!
486
486
  end
487
487
  end
488
488
  end
@@ -495,7 +495,7 @@ module Rgviz
495
495
  case c! when 'a', 'A'
496
496
  case c! when 't', 'T'
497
497
  case c! when 'e', 'E'
498
- return keyword Token::ToDate if end_of_identifier!
498
+ return keyword(Token::ToDate) if end_of_identifier!
499
499
  end
500
500
  end
501
501
  end
@@ -503,7 +503,7 @@ module Rgviz
503
503
  when 'r', 'R'
504
504
  case c! when 'u', 'U'
505
505
  case c! when 'e', 'E'
506
- return keyword Token::True if end_of_identifier!
506
+ return keyword(Token::True) if end_of_identifier!
507
507
  end
508
508
  end
509
509
  end
@@ -512,7 +512,7 @@ module Rgviz
512
512
  case c! when 'p', 'P'
513
513
  case c! when 'e', 'E'
514
514
  case c! when 'r', 'R'
515
- return keyword Token::Upper if end_of_identifier!
515
+ return keyword(Token::Upper) if end_of_identifier!
516
516
  end
517
517
  end
518
518
  end
@@ -523,14 +523,14 @@ module Rgviz
523
523
  case c! when 'e', 'E'
524
524
  case c! when 'r', 'R'
525
525
  case c! when 'e', 'E'
526
- return keyword Token::Where if end_of_identifier!
526
+ return keyword(Token::Where) if end_of_identifier!
527
527
  end
528
528
  end
529
529
  end
530
530
  when 'i', 'I'
531
531
  case c! when 't', 'T'
532
532
  case c! when 'h', 'H'
533
- return keyword Token::With if end_of_identifier!
533
+ return keyword(Token::With) if end_of_identifier!
534
534
  end
535
535
  end
536
536
  end
@@ -538,7 +538,7 @@ module Rgviz
538
538
  case c! when 'e', 'E'
539
539
  case c! when 'a', 'A'
540
540
  case c! when 'r', 'R'
541
- return keyword Token::Year if end_of_identifier!
541
+ return keyword(Token::Year) if end_of_identifier!
542
542
  end
543
543
  end
544
544
  end
@@ -549,7 +549,7 @@ module Rgviz
549
549
  when 'a' .. 'z', 'A' .. 'Z', '_'
550
550
  @p += 1
551
551
  else
552
- raise ParseException.new "Unexpected character #{c} (code: #{c[0]})"
552
+ raise ParseException.new("Unexpected character #{c} (code: #{c[0]})")
553
553
  end
554
554
  end
555
555
 
data/lib/rgviz/parser.rb CHANGED
@@ -18,7 +18,7 @@ module Rgviz
18
18
  parse_format
19
19
  parse_options
20
20
 
21
- raise ParseException.new "Expecting end of query" if @token.value != Token::EOF
21
+ raise ParseException.new("Expecting end of query") if @token.value != Token::EOF
22
22
  @query
23
23
  end
24
24
 
@@ -31,7 +31,7 @@ module Rgviz
31
31
 
32
32
  parse_columns @query.select.columns
33
33
 
34
- raise ParseException.new "Expecting select columns" if @query.select.columns.empty?
34
+ raise ParseException.new("Expecting select columns") if @query.select.columns.empty?
35
35
  end
36
36
 
37
37
  def parse_where
@@ -47,7 +47,7 @@ module Rgviz
47
47
  @query.group_by = GroupBy.new
48
48
  @query.group_by.columns = parse_columns
49
49
 
50
- raise ParseException.new "Expecting group by columns" if @query.group_by.columns.empty?
50
+ raise ParseException.new("Expecting group by columns") if @query.group_by.columns.empty?
51
51
  end
52
52
 
53
53
  def parse_pivot
@@ -56,7 +56,7 @@ module Rgviz
56
56
  @query.pivot = Pivot.new
57
57
  @query.pivot.columns = parse_columns
58
58
 
59
- raise ParseException.new "Expecting pivot columns" if @query.pivot.columns.empty?
59
+ raise ParseException.new("Expecting pivot columns") if @query.pivot.columns.empty?
60
60
  end
61
61
 
62
62
  def parse_order_by
@@ -66,7 +66,7 @@ module Rgviz
66
66
  @query.order_by = OrderBy.new
67
67
  @query.order_by.sorts = parse_sorts
68
68
 
69
- raise ParseException.new "Expecting order by columns" if @query.order_by.sorts.empty?
69
+ raise ParseException.new("Expecting order by columns") if @query.order_by.sorts.empty?
70
70
  end
71
71
 
72
72
  def parse_limit
@@ -93,7 +93,7 @@ module Rgviz
93
93
  @query.labels = []
94
94
 
95
95
  column = parse_column
96
- raise ParseException.new "Expecting label" unless column
96
+ raise ParseException.new("Expecting label") unless column
97
97
 
98
98
  check Token::STRING
99
99
  @query.labels << Label.new(column, @token.string)
@@ -108,7 +108,7 @@ module Rgviz
108
108
  next_token
109
109
  end
110
110
 
111
- raise ParseException.new "Expecting label" if @query.labels.empty?
111
+ raise ParseException.new("Expecting label") if @query.labels.empty?
112
112
  end
113
113
 
114
114
  def parse_format
@@ -117,7 +117,7 @@ module Rgviz
117
117
  @query.formats = []
118
118
 
119
119
  column = parse_column
120
- raise ParseException.new "Expecting format" unless column
120
+ raise ParseException.new("Expecting format") unless column
121
121
 
122
122
  check Token::STRING
123
123
  @query.formats << Format.new(column, @token.string)
@@ -132,7 +132,7 @@ module Rgviz
132
132
  next_token
133
133
  end
134
134
 
135
- raise ParseException.new "Expecting format" if @query.formats.empty?
135
+ raise ParseException.new("Expecting format") if @query.formats.empty?
136
136
  end
137
137
 
138
138
  def parse_options
@@ -153,8 +153,8 @@ module Rgviz
153
153
  end
154
154
  end
155
155
 
156
- raise ParseException.new "Expecting option" if !@query.options.no_format && !@query.options.no_values
157
- raise ParseException.new "Unknown option" if @token.value != Token::EOF
156
+ raise ParseException.new("Expecting option") if !@query.options.no_format && !@query.options.no_values
157
+ raise ParseException.new("Unknown option #{@token.string}") if @token.value != Token::EOF
158
158
  end
159
159
 
160
160
  def parse_sorts
@@ -232,33 +232,33 @@ module Rgviz
232
232
  return exp
233
233
  else
234
234
  left = parse_column
235
- raise ParseException.new "Expecting left exp" unless left
235
+ raise ParseException.new("Expecting left exp") unless left
236
236
 
237
237
  case @token.value
238
238
  when Token::Is
239
239
  next_token
240
240
  if token_is! Token::Not
241
241
  check! Token::Null
242
- return UnaryExpression.new UnaryExpression::IsNotNull, left
242
+ return UnaryExpression.new(UnaryExpression::IsNotNull, left)
243
243
  elsif token_is! Token::Null
244
- return UnaryExpression.new UnaryExpression::IsNull, left
244
+ return UnaryExpression.new(UnaryExpression::IsNull, left)
245
245
  end
246
246
  when Token::EQ, Token::NEQ, Token::LT, Token::LTE, Token::GT, Token::GTE,
247
247
  Token::Contains, Token::Matches, Token::Like
248
248
  operator = @token.value
249
249
  next_token
250
250
  right = parse_column
251
- raise ParseException.new "Expecting right exp" unless right
252
- return BinaryExpression.new left, operator, right
251
+ raise ParseException.new("Expecting right exp") unless right
252
+ return BinaryExpression.new(left, operator, right)
253
253
  when Token::Starts, Token::Ends
254
254
  operator = "#{@token.value} with".to_sym
255
255
  next_token
256
256
  check! Token::With
257
257
  right = parse_column
258
- raise ParseException.new "Expecting right exp" unless right
259
- return BinaryExpression.new left, operator, right
258
+ raise ParseException.new("Expecting right exp") unless right
259
+ return BinaryExpression.new(left, operator, right)
260
260
  else
261
- raise ParseException.new "Expecting comparison"
261
+ raise ParseException.new("Expecting comparison")
262
262
  end
263
263
  end
264
264
  end
@@ -368,9 +368,9 @@ module Rgviz
368
368
  if token_is! Token::LPAREN
369
369
  column = parse_column
370
370
  check! Token::RPAREN
371
- return AggregateColumn.new function, column
371
+ return AggregateColumn.new(function, column)
372
372
  else
373
- return IdColumn.new string
373
+ return IdColumn.new(string)
374
374
  end
375
375
  when Token::Year, Token::Month, Token::Day,
376
376
  Token::Hour, Token::Minute, Token::Second, Token::Millisecond,
@@ -382,9 +382,9 @@ module Rgviz
382
382
  if token_is! Token::LPAREN
383
383
  columns = parse_columns
384
384
  check! Token::RPAREN
385
- return ScalarFunctionColumn.new function, *columns
385
+ return ScalarFunctionColumn.new(function, *columns)
386
386
  else
387
- return IdColumn.new string
387
+ return IdColumn.new(string)
388
388
  end
389
389
  end
390
390
  nil
@@ -410,7 +410,7 @@ module Rgviz
410
410
  end
411
411
 
412
412
  def check(*token_values)
413
- raise ParseException.new "Expecting token #{token_values}" unless token_values.any?{|value| @token.value == value}
413
+ raise ParseException.new("Expecting token #{token_values}") unless token_values.any?{|value| @token.value == value}
414
414
  end
415
415
 
416
416
  def check!(*token_values)
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: 53
4
+ hash: 75
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 31
9
- version: "0.31"
8
+ - 32
9
+ version: "0.32"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ary Borenszweig