dentaku 3.4.2 → 3.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +4 -5
  4. data/lib/dentaku/ast/access.rb +6 -0
  5. data/lib/dentaku/ast/arithmetic.rb +23 -18
  6. data/lib/dentaku/ast/array.rb +4 -0
  7. data/lib/dentaku/ast/bitwise.rb +30 -5
  8. data/lib/dentaku/ast/case/case_conditional.rb +4 -0
  9. data/lib/dentaku/ast/case/case_else.rb +6 -0
  10. data/lib/dentaku/ast/case/case_switch_variable.rb +6 -0
  11. data/lib/dentaku/ast/case/case_then.rb +6 -0
  12. data/lib/dentaku/ast/case/case_when.rb +10 -0
  13. data/lib/dentaku/ast/case.rb +6 -0
  14. data/lib/dentaku/ast/comparators.rb +35 -35
  15. data/lib/dentaku/ast/function.rb +6 -8
  16. data/lib/dentaku/ast/functions/all.rb +4 -17
  17. data/lib/dentaku/ast/functions/any.rb +4 -17
  18. data/lib/dentaku/ast/functions/duration.rb +2 -2
  19. data/lib/dentaku/ast/functions/enum.rb +37 -0
  20. data/lib/dentaku/ast/functions/filter.rb +4 -17
  21. data/lib/dentaku/ast/functions/if.rb +4 -0
  22. data/lib/dentaku/ast/functions/map.rb +3 -16
  23. data/lib/dentaku/ast/functions/pluck.rb +8 -7
  24. data/lib/dentaku/ast/functions/ruby_math.rb +3 -2
  25. data/lib/dentaku/ast/functions/xor.rb +44 -0
  26. data/lib/dentaku/ast/identifier.rb +8 -0
  27. data/lib/dentaku/ast/literal.rb +10 -0
  28. data/lib/dentaku/ast/negation.rb +4 -0
  29. data/lib/dentaku/ast/nil.rb +4 -0
  30. data/lib/dentaku/ast/node.rb +4 -0
  31. data/lib/dentaku/ast/operation.rb +9 -0
  32. data/lib/dentaku/ast/string.rb +7 -0
  33. data/lib/dentaku/ast.rb +2 -0
  34. data/lib/dentaku/bulk_expression_solver.rb +1 -5
  35. data/lib/dentaku/exceptions.rb +2 -2
  36. data/lib/dentaku/parser.rb +10 -3
  37. data/lib/dentaku/print_visitor.rb +101 -0
  38. data/lib/dentaku/token_scanner.rb +3 -3
  39. data/lib/dentaku/version.rb +1 -1
  40. data/lib/dentaku/visitor/infix.rb +82 -0
  41. data/spec/ast/all_spec.rb +25 -0
  42. data/spec/ast/any_spec.rb +23 -0
  43. data/spec/ast/arithmetic_spec.rb +7 -0
  44. data/spec/ast/comparator_spec.rb +14 -9
  45. data/spec/ast/filter_spec.rb +7 -0
  46. data/spec/ast/function_spec.rb +5 -0
  47. data/spec/ast/map_spec.rb +12 -0
  48. data/spec/ast/or_spec.rb +1 -1
  49. data/spec/ast/pluck_spec.rb +32 -0
  50. data/spec/ast/xor_spec.rb +35 -0
  51. data/spec/bulk_expression_solver_spec.rb +9 -0
  52. data/spec/calculator_spec.rb +71 -2
  53. data/spec/parser_spec.rb +18 -3
  54. data/spec/print_visitor_spec.rb +66 -0
  55. data/spec/tokenizer_spec.rb +18 -0
  56. data/spec/visitor/infix_spec.rb +31 -0
  57. data/spec/visitor_spec.rb +138 -0
  58. metadata +24 -6
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dentaku
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.2
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Solomon White
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-16 00:00:00.000000000 Z
11
+ date: 2022-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -176,6 +176,7 @@ files:
176
176
  - lib/dentaku/ast/functions/avg.rb
177
177
  - lib/dentaku/ast/functions/count.rb
178
178
  - lib/dentaku/ast/functions/duration.rb
179
+ - lib/dentaku/ast/functions/enum.rb
179
180
  - lib/dentaku/ast/functions/filter.rb
180
181
  - lib/dentaku/ast/functions/if.rb
181
182
  - lib/dentaku/ast/functions/map.rb
@@ -192,6 +193,7 @@ files:
192
193
  - lib/dentaku/ast/functions/string_functions.rb
193
194
  - lib/dentaku/ast/functions/sum.rb
194
195
  - lib/dentaku/ast/functions/switch.rb
196
+ - lib/dentaku/ast/functions/xor.rb
195
197
  - lib/dentaku/ast/grouping.rb
196
198
  - lib/dentaku/ast/identifier.rb
197
199
  - lib/dentaku/ast/literal.rb
@@ -209,6 +211,7 @@ files:
209
211
  - lib/dentaku/exceptions.rb
210
212
  - lib/dentaku/flat_hash.rb
211
213
  - lib/dentaku/parser.rb
214
+ - lib/dentaku/print_visitor.rb
212
215
  - lib/dentaku/string_casing.rb
213
216
  - lib/dentaku/token.rb
214
217
  - lib/dentaku/token_matcher.rb
@@ -216,9 +219,12 @@ files:
216
219
  - lib/dentaku/token_scanner.rb
217
220
  - lib/dentaku/tokenizer.rb
218
221
  - lib/dentaku/version.rb
222
+ - lib/dentaku/visitor/infix.rb
219
223
  - spec/ast/addition_spec.rb
224
+ - spec/ast/all_spec.rb
220
225
  - spec/ast/and_function_spec.rb
221
226
  - spec/ast/and_spec.rb
227
+ - spec/ast/any_spec.rb
222
228
  - spec/ast/arithmetic_spec.rb
223
229
  - spec/ast/avg_spec.rb
224
230
  - spec/ast/case_spec.rb
@@ -235,12 +241,14 @@ files:
235
241
  - spec/ast/node_spec.rb
236
242
  - spec/ast/numeric_spec.rb
237
243
  - spec/ast/or_spec.rb
244
+ - spec/ast/pluck_spec.rb
238
245
  - spec/ast/round_spec.rb
239
246
  - spec/ast/rounddown_spec.rb
240
247
  - spec/ast/roundup_spec.rb
241
248
  - spec/ast/string_functions_spec.rb
242
249
  - spec/ast/sum_spec.rb
243
250
  - spec/ast/switch_spec.rb
251
+ - spec/ast/xor_spec.rb
244
252
  - spec/benchmark.rb
245
253
  - spec/bulk_expression_solver_spec.rb
246
254
  - spec/calculator_spec.rb
@@ -248,16 +256,19 @@ files:
248
256
  - spec/exceptions_spec.rb
249
257
  - spec/external_function_spec.rb
250
258
  - spec/parser_spec.rb
259
+ - spec/print_visitor_spec.rb
251
260
  - spec/spec_helper.rb
252
261
  - spec/token_matcher_spec.rb
253
262
  - spec/token_scanner_spec.rb
254
263
  - spec/token_spec.rb
255
264
  - spec/tokenizer_spec.rb
265
+ - spec/visitor/infix_spec.rb
266
+ - spec/visitor_spec.rb
256
267
  homepage: http://github.com/rubysolo/dentaku
257
268
  licenses:
258
269
  - MIT
259
270
  metadata: {}
260
- post_install_message:
271
+ post_install_message:
261
272
  rdoc_options: []
262
273
  require_paths:
263
274
  - lib
@@ -272,14 +283,16 @@ required_rubygems_version: !ruby/object:Gem::Requirement
272
283
  - !ruby/object:Gem::Version
273
284
  version: '0'
274
285
  requirements: []
275
- rubygems_version: 3.1.4
276
- signing_key:
286
+ rubygems_version: 3.3.7
287
+ signing_key:
277
288
  specification_version: 4
278
289
  summary: A formula language parser and evaluator
279
290
  test_files:
280
291
  - spec/ast/addition_spec.rb
292
+ - spec/ast/all_spec.rb
281
293
  - spec/ast/and_function_spec.rb
282
294
  - spec/ast/and_spec.rb
295
+ - spec/ast/any_spec.rb
283
296
  - spec/ast/arithmetic_spec.rb
284
297
  - spec/ast/avg_spec.rb
285
298
  - spec/ast/case_spec.rb
@@ -296,12 +309,14 @@ test_files:
296
309
  - spec/ast/node_spec.rb
297
310
  - spec/ast/numeric_spec.rb
298
311
  - spec/ast/or_spec.rb
312
+ - spec/ast/pluck_spec.rb
299
313
  - spec/ast/round_spec.rb
300
314
  - spec/ast/rounddown_spec.rb
301
315
  - spec/ast/roundup_spec.rb
302
316
  - spec/ast/string_functions_spec.rb
303
317
  - spec/ast/sum_spec.rb
304
318
  - spec/ast/switch_spec.rb
319
+ - spec/ast/xor_spec.rb
305
320
  - spec/benchmark.rb
306
321
  - spec/bulk_expression_solver_spec.rb
307
322
  - spec/calculator_spec.rb
@@ -309,8 +324,11 @@ test_files:
309
324
  - spec/exceptions_spec.rb
310
325
  - spec/external_function_spec.rb
311
326
  - spec/parser_spec.rb
327
+ - spec/print_visitor_spec.rb
312
328
  - spec/spec_helper.rb
313
329
  - spec/token_matcher_spec.rb
314
330
  - spec/token_scanner_spec.rb
315
331
  - spec/token_spec.rb
316
332
  - spec/tokenizer_spec.rb
333
+ - spec/visitor/infix_spec.rb
334
+ - spec/visitor_spec.rb