skeem 0.2.15 → 0.2.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +451 -195
  3. data/.travis.yml +27 -0
  4. data/CHANGELOG.md +26 -0
  5. data/Gemfile +2 -0
  6. data/README.md +3 -2
  7. data/Rakefile +2 -0
  8. data/appveyor.yml +3 -4
  9. data/bin/skeem +15 -15
  10. data/lib/skeem/datum_dsl.rb +40 -30
  11. data/lib/skeem/element_visitor.rb +5 -2
  12. data/lib/skeem/grammar.rb +77 -54
  13. data/lib/skeem/interpreter.rb +9 -7
  14. data/lib/skeem/parser.rb +6 -4
  15. data/lib/skeem/primitive/primitive_builder.rb +130 -122
  16. data/lib/skeem/primitive/primitive_procedure.rb +23 -25
  17. data/lib/skeem/runtime.rb +17 -15
  18. data/lib/skeem/s_expr_builder.rb +39 -147
  19. data/lib/skeem/s_expr_nodes.rb +147 -132
  20. data/lib/skeem/skeem_exception.rb +1 -0
  21. data/lib/skeem/skm_binding.rb +9 -11
  22. data/lib/skeem/skm_compound_datum.rb +9 -6
  23. data/lib/skeem/skm_element.rb +15 -13
  24. data/lib/skeem/skm_empty_list.rb +6 -4
  25. data/lib/skeem/skm_exception.rb +9 -0
  26. data/lib/skeem/skm_expression.rb +3 -1
  27. data/lib/skeem/skm_frame.rb +3 -2
  28. data/lib/skeem/skm_pair.rb +26 -18
  29. data/lib/skeem/skm_procedure_exec.rb +11 -6
  30. data/lib/skeem/skm_simple_datum.rb +23 -20
  31. data/lib/skeem/skm_unary_expression.rb +34 -37
  32. data/lib/skeem/tokenizer.rb +40 -30
  33. data/lib/skeem/version.rb +3 -1
  34. data/lib/skeem.rb +2 -0
  35. data/skeem.gemspec +7 -5
  36. data/spec/skeem/add4.skm +4 -0
  37. data/spec/skeem/datum_dsl_spec.rb +13 -12
  38. data/spec/skeem/element_visitor_spec.rb +14 -10
  39. data/spec/skeem/interpreter_spec.rb +76 -46
  40. data/spec/skeem/lambda_spec.rb +13 -11
  41. data/spec/skeem/parser_spec.rb +23 -19
  42. data/spec/skeem/primitive/primitive_builder_spec.rb +55 -46
  43. data/spec/skeem/primitive/primitive_procedure_spec.rb +14 -12
  44. data/spec/skeem/runtime_spec.rb +20 -18
  45. data/spec/skeem/s_expr_nodes_spec.rb +8 -6
  46. data/spec/skeem/skm_compound_datum_spec.rb +12 -10
  47. data/spec/skeem/skm_element_spec.rb +7 -5
  48. data/spec/skeem/skm_empty_list_spec.rb +7 -5
  49. data/spec/skeem/skm_frame_spec.rb +5 -4
  50. data/spec/skeem/skm_pair_spec.rb +9 -8
  51. data/spec/skeem/skm_procedure_exec_spec.rb +2 -0
  52. data/spec/skeem/skm_simple_datum_spec.rb +24 -22
  53. data/spec/skeem/skm_unary_expression_spec.rb +11 -9
  54. data/spec/skeem/tokenizer_spec.rb +54 -43
  55. data/spec/skeem_spec.rb +2 -0
  56. data/spec/spec_helper.rb +15 -10
  57. metadata +13 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 182cf920c536bb07dd813c34eae74af24181813a9d96fdd39c786cc28043f135
4
- data.tar.gz: ba4cf5ce2df8d1708f3504e57a14b62734146f3c8a47043cf2d5ffdf591e35d6
3
+ metadata.gz: 6ab3868544bc84674f7828b4bf258177afc7f1192ca46ea3979328ca4a410a8c
4
+ data.tar.gz: 178e5b66fed7677ef7f7a6409cd7c8fb91284654622935389cd3a0c4009b3fed
5
5
  SHA512:
6
- metadata.gz: bd03dfab05470ee167464113844c3a8b0b3174f58cd4607034f417218b91ec024e26aff941ac78e750be30ff216d18be97171b030c3f3055803443f421ad6c19
7
- data.tar.gz: 2cd279dca2e9202e6a924373a01c1a49e493ea2379131284639b07977714c72df751574a8252231d15182dc6b23d55206aaa11be062502b4840a5d9a27143199
6
+ metadata.gz: 33868367a6683ed547c5ebe19cbad9e2dee76c6b0dbd07e4a0077b6012b698a8e8d551095e82484911a71df0590f373d24e7b11a334fa760c23507e030a44314
7
+ data.tar.gz: f9726a3849a9eee31061404cf900e9529fa07db9d63663b9334105397b4c02fe2754951561049419c5e436cf846635548cd15c02e006e17ad4170e33a24be487
data/.rubocop.yml CHANGED
@@ -1,195 +1,451 @@
1
- AllCops:
2
- Exclude:
3
- - 'exp/**/*'
4
-
5
- Layout/CaseIndentation:
6
- Enabled: false
7
-
8
- Layout/CommentIndentation:
9
- Enabled: false
10
-
11
- Layout/ElseAlignment:
12
- Enabled: false
13
-
14
- Layout/EmptyLines:
15
- Enabled: false
16
-
17
- Layout/EndAlignment:
18
- Enabled: false
19
-
20
- Layout/EndOfLine:
21
- Enabled: true
22
- EnforcedStyle: lf
23
-
24
- Layout/IndentationWidth:
25
- Enabled: false
26
-
27
- Layout/IndentationConsistency:
28
- Enabled: true
29
-
30
- Layout/IndentHeredoc:
31
- Enabled: false
32
-
33
- Layout/MultilineHashBraceLayout:
34
- Enabled: true
35
-
36
- Layout/SpaceAroundOperators:
37
- Enabled: true
38
-
39
- Layout/SpaceInsideParens:
40
- Enabled: true
41
-
42
- Layout/Tab:
43
- Enabled: true
44
-
45
- Layout/TrailingBlankLines:
46
- Enabled: true
47
-
48
- Layout/TrailingWhitespace:
49
- Enabled: true
50
-
51
- Lint/Loop:
52
- Enabled: true
53
-
54
- Lint/RescueException:
55
- Enabled: true
56
-
57
- Lint/UnusedMethodArgument:
58
- Enabled: true
59
-
60
- Lint/UselessAccessModifier:
61
- Enabled: true
62
-
63
- Lint/Void:
64
- Enabled: false
65
-
66
- Lint/UselessAssignment:
67
- Enabled: true
68
-
69
- Metrics/AbcSize:
70
- Enabled: false
71
-
72
- Metrics/BlockLength:
73
- Enabled: true
74
- Max: 350
75
-
76
- Metrics/ClassLength:
77
- Enabled: true
78
- Max: 350
79
-
80
- Metrics/CyclomaticComplexity:
81
- Enabled: false
82
-
83
- Metrics/LineLength:
84
- Enabled: false
85
- Max: 90
86
-
87
- Metrics/MethodLength:
88
- Enabled: true
89
- Max: 40
90
-
91
- Metrics/ModuleLength:
92
- Enabled: true
93
- Max: 500
94
-
95
- Metrics/PerceivedComplexity:
96
- Enabled: false
97
-
98
- Naming/ConstantName:
99
- Enabled: false
100
-
101
- Naming/ClassAndModuleCamelCase:
102
- Enabled: false
103
-
104
- Naming/UncommunicativeBlockParamName:
105
- Enabled: true
106
-
107
- Naming/UncommunicativeMethodParamName:
108
- Enabled: false
109
-
110
- Naming/VariableName:
111
- Enabled: false
112
-
113
- Style/Alias:
114
- Enabled: true
115
-
116
- Layout/AlignHash:
117
- Enabled: false
118
-
119
- Style/AsciiComments:
120
- Enabled: false
121
-
122
- Style/BarePercentLiterals:
123
- Enabled: false
124
-
125
- Style/BlockComments:
126
- Enabled: false
127
-
128
- Style/CharacterLiteral:
129
- Enabled: false
130
-
131
- Style/ClassCheck:
132
- Enabled: false
133
-
134
- Style/ClassVars:
135
- Enabled: false
136
-
137
- Style/ColonMethodCall:
138
- Enabled: false
139
-
140
- Style/CommentAnnotation:
141
- Enabled: false
142
-
143
- Style/CommentedKeyword:
144
- Enabled: false
145
-
146
- Style/ConditionalAssignment:
147
- Enabled: false
148
-
149
- Style/DefWithParentheses:
150
- Enabled: true
151
-
152
- Style/Documentation:
153
- Enabled: false
154
-
155
- Style/ExpandPathArguments:
156
- Enabled: false
157
-
158
- Style/GuardClause:
159
- Enabled: false
160
-
161
- Style/IfUnlessModifier:
162
- Enabled: false
163
-
164
- Style/InverseMethods:
165
- Enabled: true
166
-
167
- Style/Next:
168
- Enabled: false
169
-
170
- Style/RaiseArgs:
171
- Enabled: true
172
-
173
- Style/RedundantReturn:
174
- Enabled: false
175
-
176
- Style/RedundantSelf:
177
- Enabled: true
178
-
179
- Style/RegexpLiteral:
180
- Enabled: false
181
-
182
- Style/PercentLiteralDelimiters:
183
- Enabled: false
184
-
185
- Style/StderrPuts:
186
- Enabled: false
187
-
188
- Style/StringLiterals:
189
- Enabled: true
190
-
191
- Style/TernaryParentheses:
192
- Enabled: false
193
-
194
- Style/UnlessElse:
195
- Enabled: false
1
+ AllCops:
2
+ Exclude:
3
+ - 'exp/**/*'
4
+
5
+ Gemspec/DateAssignment:
6
+ Enabled: true
7
+
8
+ Layout/ArgumentAlignment:
9
+ Enabled: false
10
+
11
+ Layout/ArrayAlignment:
12
+ Enabled: true
13
+ EnforcedStyle: with_fixed_indentation
14
+
15
+ Layout/CaseIndentation:
16
+ Enabled: false
17
+
18
+ Layout/ClosingHeredocIndentation:
19
+ Enabled: false
20
+
21
+ Layout/CommentIndentation:
22
+ Enabled: false
23
+
24
+ Layout/ElseAlignment:
25
+ Enabled: false
26
+
27
+ Layout/EmptyLines:
28
+ Enabled: false
29
+
30
+ Layout/EndAlignment:
31
+ Enabled: false
32
+
33
+ Layout/EndOfLine:
34
+ Enabled: true
35
+ EnforcedStyle: lf
36
+
37
+ Layout/FirstArgumentIndentation:
38
+ Enabled: false
39
+
40
+ Layout/HashAlignment:
41
+ Enabled: false
42
+
43
+ Layout/IndentationWidth:
44
+ Enabled: false
45
+
46
+ Layout/IndentationConsistency:
47
+ Enabled: true
48
+
49
+ Layout/HeredocIndentation:
50
+ Enabled: false
51
+
52
+ Layout/LineEndStringConcatenationIndentation:
53
+ Enabled: true
54
+
55
+ Layout/MultilineHashBraceLayout:
56
+ Enabled: true
57
+
58
+ Layout/MultilineMethodCallBraceLayout:
59
+ Enabled: true
60
+ EnforcedStyle: same_line
61
+
62
+ Layout/SpaceAroundOperators:
63
+ Enabled: true
64
+
65
+ Layout/SpaceBeforeBrackets:
66
+ Enabled: true
67
+
68
+ Layout/SpaceInsideParens:
69
+ Enabled: true
70
+
71
+ Layout/IndentationStyle:
72
+ Enabled: true
73
+
74
+ Layout/SpaceAroundMethodCallOperator:
75
+ Enabled: true
76
+
77
+ Layout/TrailingEmptyLines:
78
+ Enabled: true
79
+
80
+ Layout/TrailingWhitespace:
81
+ Enabled: true
82
+
83
+ Lint/AmbiguousAssignment:
84
+ Enabled: true
85
+
86
+ Lint/AmbiguousRange:
87
+ Enabled: true
88
+
89
+ Lint/DeprecatedConstants:
90
+ Enabled: true
91
+
92
+ Lint/DuplicateBranch:
93
+ Enabled: true
94
+
95
+ Lint/DuplicateRegexpCharacterClassElement:
96
+ Enabled: true
97
+
98
+ Lint/EmptyBlock:
99
+ Enabled: true
100
+
101
+ Lint/EmptyClass:
102
+ Enabled: false
103
+
104
+ Lint/EmptyInPattern:
105
+ Enabled: true
106
+
107
+ Lint/LambdaWithoutLiteralBlock:
108
+ Enabled: true
109
+
110
+ Lint/Loop:
111
+ Enabled: true
112
+
113
+ Lint/NoReturnInBeginEndBlocks:
114
+ Enabled: true
115
+
116
+ Lint/NumberedParameterAssignment:
117
+ Enabled: true
118
+
119
+ Lint/OrAssignmentToConstant:
120
+ Enabled: true
121
+
122
+ Lint/RaiseException:
123
+ Enabled: true
124
+
125
+ Lint/RedundantDirGlobSort:
126
+ Enabled: true
127
+
128
+ Lint/RescueException:
129
+ Enabled: true
130
+
131
+ Lint/StructNewOverride:
132
+ Enabled: true
133
+
134
+ Lint/SymbolConversion:
135
+ Enabled: true
136
+
137
+ Lint/ToEnumArguments:
138
+ Enabled: true
139
+
140
+ Lint/TripleQuotes:
141
+ Enabled: true
142
+
143
+ Lint/UnexpectedBlockArity:
144
+ Enabled: true
145
+
146
+ Lint/UnmodifiedReduceAccumulator:
147
+ Enabled: true
148
+
149
+ Lint/UnusedMethodArgument:
150
+ Enabled: true
151
+
152
+ Lint/UselessAccessModifier:
153
+ Enabled: true
154
+
155
+ Lint/Void:
156
+ Enabled: false
157
+
158
+ Lint/UselessAssignment:
159
+ Enabled: true
160
+
161
+ Metrics/AbcSize:
162
+ Enabled: false
163
+
164
+ Metrics/BlockLength:
165
+ Enabled: true
166
+ Max: 350
167
+
168
+ Metrics/BlockNesting:
169
+ Enabled: true
170
+ Max: 5
171
+
172
+ Metrics/ClassLength:
173
+ Enabled: true
174
+ Max: 450
175
+
176
+ Metrics/CyclomaticComplexity:
177
+ Enabled: false
178
+
179
+ Layout/LineLength:
180
+ Enabled: false
181
+ Max: 90
182
+
183
+ Metrics/MethodLength:
184
+ Enabled: true
185
+ Max: 60
186
+
187
+ Metrics/ModuleLength:
188
+ Enabled: true
189
+ Max: 500
190
+
191
+ Metrics/PerceivedComplexity:
192
+ Enabled: false
193
+
194
+ Naming/ConstantName:
195
+ Enabled: false
196
+
197
+ Naming/ClassAndModuleCamelCase:
198
+ Enabled: false
199
+
200
+ Naming/BlockParameterName:
201
+ Enabled: true
202
+
203
+ Naming/InclusiveLanguage:
204
+ Enabled: true
205
+
206
+ Naming/MethodParameterName:
207
+ Enabled: false
208
+
209
+ Naming/MethodName:
210
+ Enabled: false
211
+
212
+ Naming/VariableName:
213
+ Enabled: false
214
+
215
+ Style/AccessorGrouping:
216
+ Enabled: false
217
+
218
+ Style/Alias:
219
+ Enabled: true
220
+
221
+ Style/ArgumentsForwarding:
222
+ Enabled: true
223
+
224
+ Style/AsciiComments:
225
+ Enabled: false
226
+
227
+ Style/BarePercentLiterals:
228
+ Enabled: false
229
+
230
+ Style/BlockComments:
231
+ Enabled: false
232
+
233
+ Style/CharacterLiteral:
234
+ Enabled: false
235
+
236
+ Style/ClassCheck:
237
+ Enabled: false
238
+
239
+ Style/ClassVars:
240
+ Enabled: false
241
+
242
+ Style/CollectionCompact:
243
+ Enabled: true
244
+
245
+ Style/ColonMethodCall:
246
+ Enabled: false
247
+
248
+ Style/CommentAnnotation:
249
+ Enabled: false
250
+
251
+ Style/CommentedKeyword:
252
+ Enabled: false
253
+
254
+ Style/ConditionalAssignment:
255
+ Enabled: false
256
+
257
+ Style/DefWithParentheses:
258
+ Enabled: true
259
+
260
+ Style/Documentation:
261
+ Enabled: false
262
+
263
+ Style/DocumentDynamicEvalDefinition:
264
+ Enabled: false
265
+
266
+ Style/ExpandPathArguments:
267
+ Enabled: false
268
+
269
+ Style/ExponentialNotation:
270
+ Enabled: true
271
+
272
+ Style/GuardClause:
273
+ Enabled: false
274
+
275
+ Style/HashEachMethods:
276
+ Enabled: true
277
+
278
+ Style/HashExcept:
279
+ Enabled: true
280
+
281
+ Style/HashTransformKeys:
282
+ Enabled: true
283
+
284
+ Style/HashTransformValues:
285
+ Enabled: true
286
+
287
+ Style/IfUnlessModifier:
288
+ Enabled: false
289
+
290
+ Style/InPatternThen:
291
+ Enabled: true
292
+
293
+ Style/InverseMethods:
294
+ Enabled: false
295
+
296
+ Style/MissingRespondToMissing:
297
+ Enabled: false
298
+
299
+ Style/MultilineInPatternThen:
300
+ Enabled: true
301
+
302
+ Style/NegatedIfElseCondition:
303
+ Enabled: true
304
+
305
+ Style/Next:
306
+ Enabled: false
307
+
308
+ Style/NilLambda:
309
+ Enabled: true
310
+
311
+ Style/NumericLiterals:
312
+ Enabled: false
313
+
314
+ Style/QuotedSymbols:
315
+ Enabled: true
316
+
317
+ Style/RaiseArgs:
318
+ Enabled: true
319
+
320
+ Style/RedundantArgument:
321
+ Enabled: true
322
+
323
+ Style/RedundantReturn:
324
+ Enabled: false
325
+
326
+ Style/RedundantSelf:
327
+ Enabled: true
328
+
329
+ Style/RedundantSelfAssignmentBranch:
330
+ Enabled: true
331
+
332
+ Style/RegexpLiteral:
333
+ Enabled: false
334
+
335
+ Style/PercentLiteralDelimiters:
336
+ Enabled: false
337
+
338
+ Style/StderrPuts:
339
+ Enabled: false
340
+
341
+ Style/StringLiterals:
342
+ Enabled: true
343
+
344
+ Style/SwapValues:
345
+ Enabled: true
346
+
347
+ Style/TernaryParentheses:
348
+ Enabled: false
349
+
350
+ Style/UnlessElse:
351
+ Enabled: false
352
+
353
+ # Rubocop complains when it doesn't find an explicit setting for the following cops:
354
+ Layout/EmptyLinesAroundAttributeAccessor:
355
+ Enabled: true
356
+
357
+ Lint/BinaryOperatorWithIdenticalOperands:
358
+ Enabled: true
359
+
360
+ Lint/DeprecatedOpenSSLConstant:
361
+ Enabled: true
362
+
363
+ Lint/DuplicateElsifCondition:
364
+ Enabled: true
365
+
366
+ Lint/DuplicateRescueException:
367
+ Enabled: true
368
+
369
+ Lint/EmptyConditionalBody:
370
+ Enabled: true
371
+
372
+ Lint/FloatComparison:
373
+ Enabled: true
374
+
375
+ Lint/MissingSuper:
376
+ Enabled: true
377
+
378
+ Lint/MixedRegexpCaptureTypes:
379
+ Enabled: true
380
+
381
+ Lint/OutOfRangeRegexpRef:
382
+ Enabled: true
383
+
384
+ Lint/SelfAssignment:
385
+ Enabled: true
386
+
387
+ Lint/TopLevelReturnWithArgument:
388
+ Enabled: true
389
+
390
+ Lint/UnreachableLoop:
391
+ Enabled: true
392
+
393
+ Style/ArrayCoercion:
394
+ Enabled: true
395
+
396
+ Style/BisectedAttrAccessor:
397
+ Enabled: true
398
+
399
+ Style/CaseLikeIf:
400
+ Enabled: true
401
+
402
+ Style/EndlessMethod:
403
+ Enabled: true
404
+
405
+ Style/ExplicitBlockArgument:
406
+ Enabled: true
407
+
408
+ Style/GlobalStdStream:
409
+ Enabled: true
410
+
411
+ Style/HashAsLastArrayItem:
412
+ Enabled: true
413
+
414
+ Style/HashConversion:
415
+ Enabled: true
416
+
417
+ Style/HashLikeCase:
418
+ Enabled: true
419
+
420
+ Style/IfWithBooleanLiteralBranches:
421
+ Enabled: true
422
+
423
+ Style/OptionalBooleanParameter:
424
+ Enabled: true
425
+
426
+ Style/RedundantAssignment:
427
+ Enabled: true
428
+
429
+ Style/RedundantFetchBlock:
430
+ Enabled: true
431
+
432
+ Style/RedundantFileExtensionInRequire:
433
+ Enabled: true
434
+
435
+ Style/RedundantRegexpCharacterClass:
436
+ Enabled: true
437
+
438
+ Style/RedundantRegexpEscape:
439
+ Enabled: true
440
+
441
+ Style/SingleArgumentDig:
442
+ Enabled: true
443
+
444
+ Style/SlicingWithRange:
445
+ Enabled: true
446
+
447
+ Style/StringChars:
448
+ Enabled: true
449
+
450
+ Style/StringConcatenation:
451
+ Enabled: true