skeem 0.2.21 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +33 -337
- data/CHANGELOG.md +7 -0
- data/LICENSE.txt +1 -1
- data/lib/skeem/grammar.rb +13 -13
- data/lib/skeem/interpreter.rb +1 -1
- data/lib/skeem/primitive/primitive_builder.rb +1 -1
- data/lib/skeem/primitive/primitive_procedure.rb +1 -1
- data/lib/skeem/runtime.rb +2 -0
- data/lib/skeem/s_expr_nodes.rb +5 -3
- data/lib/skeem/tokenizer.rb +15 -20
- data/lib/skeem/version.rb +1 -1
- data/lib/skeem.rb +2 -2
- data/skeem.gemspec +8 -5
- data/spec/skeem/datum_dsl_spec.rb +50 -50
- data/spec/skeem/element_visitor_spec.rb +108 -108
- data/spec/skeem/interpreter_spec.rb +171 -169
- data/spec/skeem/lambda_spec.rb +27 -27
- data/spec/skeem/parser_spec.rb +27 -25
- data/spec/skeem/primitive/primitive_builder_spec.rb +127 -131
- data/spec/skeem/primitive/primitive_procedure_spec.rb +28 -28
- data/spec/skeem/runtime_spec.rb +52 -51
- data/spec/skeem/s_expr_nodes_spec.rb +31 -31
- data/spec/skeem/skm_compound_datum_spec.rb +36 -35
- data/spec/skeem/skm_element_spec.rb +35 -34
- data/spec/skeem/skm_empty_list_spec.rb +19 -19
- data/spec/skeem/skm_frame_spec.rb +49 -46
- data/spec/skeem/skm_pair_spec.rb +93 -93
- data/spec/skeem/skm_procedure_exec_spec.rb +11 -11
- data/spec/skeem/skm_simple_datum_spec.rb +102 -95
- data/spec/skeem/skm_unary_expression_spec.rb +60 -61
- data/spec/skeem/tokenizer_spec.rb +52 -52
- data/spec/skeem_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -2
- metadata +62 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60bb3901b33cd2d27438d530516ead6eba76ddad2b1b25bc1714b138cd4eea98
|
4
|
+
data.tar.gz: 2d1e4862d0be1fad47146fde29c31598e7dbcc096de7cdb061809b098fa3c49e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c6928ec6c977253e8f22f2ace0e09fb26117a39f17c599240e1eae8380fd136e65cfda81aeb01907faee608c8c88a7c785358eda8ccc1d8683bee0904a682b9
|
7
|
+
data.tar.gz: c5e07ae2fc4edefd4a17e63dd27bc2044d8646e2165c2d50dbe5614f6b985f2f0a9f7cd0f2d2ce1d0da50f9bf13b036322245f829376a79f4bc1620bd4a890a6
|
data/.rubocop.yml
CHANGED
@@ -2,12 +2,11 @@ AllCops:
|
|
2
2
|
Exclude:
|
3
3
|
- 'exp/**/*'
|
4
4
|
- 'demo/**/*'
|
5
|
-
|
6
|
-
|
7
|
-
Enabled: true
|
5
|
+
NewCops: enable
|
6
|
+
SuggestExtensions: false
|
8
7
|
|
9
8
|
Gemspec/RequireMFA: # new in 1.23
|
10
|
-
Enabled:
|
9
|
+
Enabled: true
|
11
10
|
|
12
11
|
Layout/ArgumentAlignment:
|
13
12
|
Enabled: false
|
@@ -53,127 +52,10 @@ Layout/IndentationConsistency:
|
|
53
52
|
Layout/HeredocIndentation:
|
54
53
|
Enabled: false
|
55
54
|
|
56
|
-
Layout/LineEndStringConcatenationIndentation:
|
57
|
-
Enabled: true
|
58
|
-
|
59
|
-
Layout/MultilineHashBraceLayout:
|
60
|
-
Enabled: true
|
61
|
-
|
62
55
|
Layout/MultilineMethodCallBraceLayout:
|
63
56
|
Enabled: true
|
64
57
|
EnforcedStyle: same_line
|
65
58
|
|
66
|
-
Layout/SpaceAroundOperators:
|
67
|
-
Enabled: true
|
68
|
-
|
69
|
-
Layout/SpaceBeforeBrackets:
|
70
|
-
Enabled: true
|
71
|
-
|
72
|
-
Layout/SpaceInsideParens:
|
73
|
-
Enabled: true
|
74
|
-
|
75
|
-
Layout/IndentationStyle:
|
76
|
-
Enabled: true
|
77
|
-
|
78
|
-
Layout/SpaceAroundMethodCallOperator:
|
79
|
-
Enabled: true
|
80
|
-
|
81
|
-
Layout/TrailingEmptyLines:
|
82
|
-
Enabled: true
|
83
|
-
|
84
|
-
Layout/TrailingWhitespace:
|
85
|
-
Enabled: true
|
86
|
-
|
87
|
-
Lint/AmbiguousAssignment:
|
88
|
-
Enabled: true
|
89
|
-
|
90
|
-
Lint/AmbiguousOperatorPrecedence: # new in 1.21
|
91
|
-
Enabled: true
|
92
|
-
|
93
|
-
Lint/AmbiguousRange:
|
94
|
-
Enabled: true
|
95
|
-
|
96
|
-
Lint/DeprecatedConstants:
|
97
|
-
Enabled: true
|
98
|
-
|
99
|
-
Lint/DuplicateBranch:
|
100
|
-
Enabled: true
|
101
|
-
|
102
|
-
Lint/DuplicateRegexpCharacterClassElement:
|
103
|
-
Enabled: true
|
104
|
-
|
105
|
-
Lint/EmptyBlock:
|
106
|
-
Enabled: true
|
107
|
-
|
108
|
-
Lint/EmptyClass:
|
109
|
-
Enabled: false
|
110
|
-
|
111
|
-
Lint/EmptyInPattern:
|
112
|
-
Enabled: true
|
113
|
-
|
114
|
-
Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21
|
115
|
-
Enabled: true
|
116
|
-
|
117
|
-
Lint/LambdaWithoutLiteralBlock:
|
118
|
-
Enabled: true
|
119
|
-
|
120
|
-
Lint/Loop:
|
121
|
-
Enabled: true
|
122
|
-
|
123
|
-
Lint/NoReturnInBeginEndBlocks:
|
124
|
-
Enabled: true
|
125
|
-
|
126
|
-
Lint/NumberedParameterAssignment:
|
127
|
-
Enabled: true
|
128
|
-
|
129
|
-
Lint/OrAssignmentToConstant:
|
130
|
-
Enabled: true
|
131
|
-
|
132
|
-
Lint/RaiseException:
|
133
|
-
Enabled: true
|
134
|
-
|
135
|
-
Lint/RedundantDirGlobSort:
|
136
|
-
Enabled: true
|
137
|
-
|
138
|
-
Lint/RefinementImportMethods: # new in 1.27
|
139
|
-
Enabled: true
|
140
|
-
|
141
|
-
Lint/RequireRelativeSelfPath: # new in 1.22
|
142
|
-
Enabled: true
|
143
|
-
|
144
|
-
Lint/RescueException:
|
145
|
-
Enabled: true
|
146
|
-
|
147
|
-
Lint/StructNewOverride:
|
148
|
-
Enabled: true
|
149
|
-
|
150
|
-
Lint/SymbolConversion:
|
151
|
-
Enabled: true
|
152
|
-
|
153
|
-
Lint/ToEnumArguments:
|
154
|
-
Enabled: true
|
155
|
-
|
156
|
-
Lint/TripleQuotes:
|
157
|
-
Enabled: true
|
158
|
-
|
159
|
-
Lint/UnexpectedBlockArity:
|
160
|
-
Enabled: true
|
161
|
-
|
162
|
-
Lint/UnmodifiedReduceAccumulator:
|
163
|
-
Enabled: true
|
164
|
-
|
165
|
-
Lint/UnusedMethodArgument:
|
166
|
-
Enabled: true
|
167
|
-
|
168
|
-
Lint/UselessAccessModifier:
|
169
|
-
Enabled: true
|
170
|
-
|
171
|
-
Lint/UselessAssignment:
|
172
|
-
Enabled: true
|
173
|
-
|
174
|
-
Lint/UselessRuby2Keywords: # new in 1.23
|
175
|
-
Enabled: true
|
176
|
-
|
177
59
|
Lint/Void:
|
178
60
|
Enabled: false
|
179
61
|
|
@@ -210,21 +92,12 @@ Metrics/ModuleLength:
|
|
210
92
|
Metrics/PerceivedComplexity:
|
211
93
|
Enabled: false
|
212
94
|
|
213
|
-
Naming/BlockForwarding: # new in 1.24
|
214
|
-
Enabled: true
|
215
|
-
|
216
|
-
Naming/BlockParameterName:
|
217
|
-
Enabled: true
|
218
|
-
|
219
95
|
Naming/ConstantName:
|
220
96
|
Enabled: false
|
221
97
|
|
222
98
|
Naming/ClassAndModuleCamelCase:
|
223
99
|
Enabled: false
|
224
100
|
|
225
|
-
Naming/InclusiveLanguage:
|
226
|
-
Enabled: true
|
227
|
-
|
228
101
|
Naming/MethodParameterName:
|
229
102
|
Enabled: false
|
230
103
|
|
@@ -234,18 +107,6 @@ Naming/MethodName:
|
|
234
107
|
Naming/VariableName:
|
235
108
|
Enabled: false
|
236
109
|
|
237
|
-
Security/CompoundHash: # new in 1.28
|
238
|
-
Enabled: true
|
239
|
-
|
240
|
-
Security/IoMethods: # new in 1.22
|
241
|
-
Enabled: true
|
242
|
-
|
243
|
-
Style/Alias:
|
244
|
-
Enabled: true
|
245
|
-
|
246
|
-
Style/ArgumentsForwarding:
|
247
|
-
Enabled: true
|
248
|
-
|
249
110
|
Style/AsciiComments:
|
250
111
|
Enabled: false
|
251
112
|
|
@@ -264,9 +125,6 @@ Style/ClassCheck:
|
|
264
125
|
Style/ClassVars:
|
265
126
|
Enabled: false
|
266
127
|
|
267
|
-
Style/CollectionCompact:
|
268
|
-
Enabled: true
|
269
|
-
|
270
128
|
Style/ColonMethodCall:
|
271
129
|
Enabled: false
|
272
130
|
|
@@ -279,234 +137,72 @@ Style/CommentedKeyword:
|
|
279
137
|
Style/ConditionalAssignment:
|
280
138
|
Enabled: false
|
281
139
|
|
282
|
-
Style/DefWithParentheses:
|
283
|
-
Enabled: true
|
284
|
-
|
285
140
|
Style/Documentation:
|
286
141
|
Enabled: false
|
287
142
|
|
288
|
-
Style/DocumentDynamicEvalDefinition:
|
289
|
-
Enabled: true
|
290
|
-
|
291
143
|
Style/ExpandPathArguments:
|
292
144
|
Enabled: false
|
293
145
|
|
294
|
-
Style/ExponentialNotation:
|
295
|
-
Enabled: true
|
296
|
-
|
297
|
-
Style/FetchEnvVar: # new in 1.28
|
298
|
-
Enabled: true
|
299
|
-
|
300
|
-
Style/FileRead: # new in 1.24
|
301
|
-
Enabled: true
|
302
|
-
|
303
|
-
Style/FileWrite: # new in 1.24
|
304
|
-
Enabled: true
|
305
|
-
|
306
146
|
Style/GuardClause:
|
307
147
|
Enabled: false
|
308
148
|
|
309
|
-
Style/HashEachMethods:
|
310
|
-
Enabled: true
|
311
|
-
|
312
|
-
Style/HashExcept:
|
313
|
-
Enabled: true
|
314
|
-
|
315
|
-
Style/HashTransformKeys:
|
316
|
-
Enabled: true
|
317
|
-
|
318
|
-
Style/HashTransformValues:
|
319
|
-
Enabled: true
|
320
|
-
|
321
149
|
Style/IfUnlessModifier:
|
322
150
|
Enabled: false
|
323
151
|
|
324
|
-
Style/InPatternThen:
|
325
|
-
Enabled: true
|
326
|
-
|
327
152
|
Style/InverseMethods:
|
328
153
|
Enabled: false
|
329
154
|
|
330
|
-
Style/MapToHash: # new in 1.24
|
331
|
-
Enabled: true
|
332
|
-
|
333
155
|
Style/MissingRespondToMissing:
|
334
156
|
Enabled: false
|
335
157
|
|
336
|
-
Style/MultilineInPatternThen:
|
337
|
-
Enabled: true
|
338
|
-
|
339
|
-
Style/NegatedIfElseCondition:
|
340
|
-
Enabled: true
|
341
|
-
|
342
|
-
Style/NestedFileDirname: # new in 1.26
|
343
|
-
Enabled: true
|
344
|
-
|
345
158
|
Style/Next:
|
346
159
|
Enabled: false
|
347
160
|
|
348
|
-
Style/NilLambda:
|
349
|
-
Enabled: true
|
350
|
-
|
351
|
-
Style/NumberedParameters: # new in 1.22
|
352
|
-
Enabled: true
|
353
|
-
|
354
|
-
Style/NumberedParametersLimit: # new in 1.22
|
355
|
-
Enabled: true
|
356
|
-
|
357
161
|
Style/NumericLiterals:
|
358
162
|
Enabled: false
|
359
163
|
|
360
|
-
Style/ObjectThen: # new in 1.28
|
361
|
-
Enabled: true
|
362
|
-
|
363
|
-
Style/OpenStructUse: # new in 1.23
|
364
|
-
Enabled: true
|
365
|
-
|
366
|
-
Style/QuotedSymbols:
|
367
|
-
Enabled: true
|
368
|
-
|
369
|
-
Style/RaiseArgs:
|
370
|
-
Enabled: true
|
371
|
-
|
372
|
-
Style/RedundantArgument:
|
373
|
-
Enabled: true
|
374
|
-
|
375
|
-
Style/RedundantInitialize: # new in 1.27
|
376
|
-
Enabled: true
|
377
|
-
|
378
|
-
Style/RedundantReturn:
|
379
|
-
Enabled: true
|
380
|
-
|
381
|
-
Style/RedundantSelf:
|
382
|
-
Enabled: true
|
383
|
-
|
384
|
-
Style/RedundantSelfAssignmentBranch:
|
385
|
-
Enabled: true
|
386
|
-
|
387
164
|
Style/RegexpLiteral:
|
388
165
|
Enabled: false
|
389
166
|
|
390
167
|
Style/PercentLiteralDelimiters:
|
391
168
|
Enabled: false
|
392
169
|
|
393
|
-
Style/SelectByRegexp: # new in 1.22
|
394
|
-
Enabled: true
|
395
|
-
|
396
170
|
Style/StderrPuts:
|
397
171
|
Enabled: false
|
398
172
|
|
399
|
-
Style/StringLiterals:
|
400
|
-
Enabled: true
|
401
|
-
|
402
|
-
Style/SwapValues:
|
403
|
-
Enabled: true
|
404
|
-
|
405
173
|
Style/TernaryParentheses:
|
406
174
|
Enabled: false
|
407
175
|
|
408
176
|
Style/UnlessElse:
|
409
177
|
Enabled: false
|
410
178
|
|
411
|
-
|
412
|
-
|
413
|
-
Enabled:
|
414
|
-
|
415
|
-
|
416
|
-
Enabled:
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
Enabled:
|
426
|
-
|
427
|
-
|
428
|
-
Enabled:
|
429
|
-
|
430
|
-
|
431
|
-
Enabled:
|
432
|
-
|
433
|
-
|
434
|
-
Enabled:
|
435
|
-
|
436
|
-
|
437
|
-
Enabled:
|
438
|
-
|
439
|
-
|
440
|
-
Enabled:
|
441
|
-
|
442
|
-
Lint/SelfAssignment:
|
443
|
-
Enabled: true
|
444
|
-
|
445
|
-
Lint/TopLevelReturnWithArgument:
|
446
|
-
Enabled: true
|
447
|
-
|
448
|
-
Lint/UnreachableLoop:
|
449
|
-
Enabled: true
|
450
|
-
|
451
|
-
Style/AccessorGrouping:
|
452
|
-
Enabled: true
|
453
|
-
|
454
|
-
Style/ArrayCoercion:
|
455
|
-
Enabled: true
|
456
|
-
|
457
|
-
Style/BisectedAttrAccessor:
|
458
|
-
Enabled: true
|
459
|
-
|
460
|
-
Style/CaseLikeIf:
|
461
|
-
Enabled: true
|
462
|
-
|
463
|
-
Style/EndlessMethod:
|
464
|
-
Enabled: true
|
465
|
-
|
466
|
-
Style/ExplicitBlockArgument:
|
467
|
-
Enabled: true
|
468
|
-
|
469
|
-
Style/GlobalStdStream:
|
470
|
-
Enabled: true
|
471
|
-
|
472
|
-
Style/HashAsLastArrayItem:
|
473
|
-
Enabled: true
|
474
|
-
|
475
|
-
Style/HashConversion:
|
476
|
-
Enabled: true
|
477
|
-
|
478
|
-
Style/HashLikeCase:
|
479
|
-
Enabled: true
|
480
|
-
|
481
|
-
Style/IfWithBooleanLiteralBranches:
|
482
|
-
Enabled: true
|
483
|
-
|
484
|
-
Style/OptionalBooleanParameter:
|
485
|
-
Enabled: true
|
486
|
-
|
487
|
-
Style/RedundantAssignment:
|
488
|
-
Enabled: true
|
489
|
-
|
490
|
-
Style/RedundantFetchBlock:
|
491
|
-
Enabled: true
|
492
|
-
|
493
|
-
Style/RedundantFileExtensionInRequire:
|
494
|
-
Enabled: true
|
495
|
-
|
496
|
-
Style/RedundantRegexpCharacterClass:
|
497
|
-
Enabled: true
|
498
|
-
|
499
|
-
Style/RedundantRegexpEscape:
|
500
|
-
Enabled: true
|
501
|
-
|
502
|
-
Style/SingleArgumentDig:
|
503
|
-
Enabled: true
|
504
|
-
|
505
|
-
Style/SlicingWithRange:
|
506
|
-
Enabled: true
|
507
|
-
|
508
|
-
Style/StringChars:
|
509
|
-
Enabled: true
|
510
|
-
|
511
|
-
Style/StringConcatenation:
|
512
|
-
Enabled: true
|
179
|
+
## Optional rubocop-rspec plugin rule checking
|
180
|
+
#RSpec/ContextWording:
|
181
|
+
# Enabled: false
|
182
|
+
#
|
183
|
+
#RSpec/DescribeClass:
|
184
|
+
# Enabled: false
|
185
|
+
#
|
186
|
+
#RSpec/ExampleLength:
|
187
|
+
# Max: 45
|
188
|
+
#
|
189
|
+
#RSpec/MultipleExpectations:
|
190
|
+
# Max: 25
|
191
|
+
#
|
192
|
+
#RSpec/NoExpectationExample:
|
193
|
+
# Enabled: false
|
194
|
+
#
|
195
|
+
#RSpec/RepeatedDescription:
|
196
|
+
# Enabled: false
|
197
|
+
#
|
198
|
+
#RSpec/RepeatedExample:
|
199
|
+
# Enabled: false
|
200
|
+
#
|
201
|
+
#RSpec/RepeatedExampleGroupDescription:
|
202
|
+
# Enabled: false
|
203
|
+
#
|
204
|
+
#RSpec/VerifiedDoubles:
|
205
|
+
# Enabled: false
|
206
|
+
#
|
207
|
+
#RSpec/IdenticalEqualityAssertion:
|
208
|
+
# Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.2.22] - 2025-03-30
|
2
|
+
- Dependency updates, minor changes, tested against Ruby 3.4.1.
|
3
|
+
|
4
|
+
### Changed
|
5
|
+
- Files updated to please Rubocop 1.75.1
|
6
|
+
- Files `*_spec.rb` updated to please `rubocop-rspec`.
|
7
|
+
|
1
8
|
## [0.2.21] - 2022-04-24
|
2
9
|
- Dependencies updates, minor changes
|
3
10
|
|
data/LICENSE.txt
CHANGED
data/lib/skeem/grammar.rb
CHANGED
@@ -137,14 +137,14 @@ END_SYNTAX
|
|
137
137
|
rule('transformer_spec' => 'LPAREN SYNTAX-RULES IDENTIFIER LPAREN IDENTIFIER* RPAREN syntax_rule* RPAREN')
|
138
138
|
rule('syntax_rule' => 'LPAREN pattern template RPAREN').as 'syntax_rule'
|
139
139
|
rule('pattern' => 'pattern_identifier')
|
140
|
-
rule('pattern' =>
|
141
|
-
rule('pattern' =>
|
142
|
-
rule('pattern' =>
|
143
|
-
rule('pattern' =>
|
144
|
-
rule('pattern' =>
|
145
|
-
rule('pattern' =>
|
146
|
-
rule('pattern' =>
|
147
|
-
rule('pattern' =>
|
140
|
+
rule('pattern' => 'UNDERSCORE')
|
141
|
+
rule('pattern' => 'LPAREN pattern* RPAREN')
|
142
|
+
rule('pattern' => 'LPAREN pattern+ PERIOD pattern RPAREN')
|
143
|
+
rule('pattern' => 'LPAREN pattern+ ELLIPSIS pattern* RPAREN')
|
144
|
+
rule('pattern' => 'LPAREN pattern+ ELLIPSIS pattern* PERIOD pattern RPAREN')
|
145
|
+
rule('pattern' => 'VECTOR_BEGIN pattern* RPAREN')
|
146
|
+
rule('pattern' => 'VECTOR_BEGIN pattern+ ELLIPSIS pattern* RPAREN')
|
147
|
+
rule('pattern' => 'pattern_datum')
|
148
148
|
rule('pattern_datum' => 'STRING_LIT')
|
149
149
|
rule('pattern_datum' => 'CHAR')
|
150
150
|
rule('pattern_datum' => 'BOOLEAN')
|
@@ -153,11 +153,11 @@ END_SYNTAX
|
|
153
153
|
rule('template' => 'pattern_identifier')
|
154
154
|
rule('template' => 'LPAREN template_element* RPAREN')
|
155
155
|
rule('template' => 'LPAREN template_element+ PERIOD template RPAREN')
|
156
|
-
rule('template' =>
|
157
|
-
rule('template' =>
|
158
|
-
rule('template_element' =>
|
159
|
-
rule('template_element' =>
|
160
|
-
rule('template_datum' =>
|
156
|
+
rule('template' => 'VECTOR_BEGIN template_element* RPAREN')
|
157
|
+
rule('template' => 'template_datum')
|
158
|
+
rule('template_element' => 'template')
|
159
|
+
rule('template_element' => 'template ELLIPSIS')
|
160
|
+
rule('template_datum' => 'pattern_datum')
|
161
161
|
rule('pattern_identifier' => 'IDENTIFIER')
|
162
162
|
# Ugly: specialized production rule per keyword...
|
163
163
|
rule('pattern_identifier' => 'BEGIN')
|
data/lib/skeem/interpreter.rb
CHANGED
@@ -1112,7 +1112,7 @@ module Skeem
|
|
1112
1112
|
def create_display(aRuntime)
|
1113
1113
|
primitive = lambda do |_runtime, arg_evaluated|
|
1114
1114
|
# @TODO: make output stream configurable
|
1115
|
-
print arg_evaluated.value
|
1115
|
+
print arg_evaluated.value
|
1116
1116
|
SkmUndefined.instance
|
1117
1117
|
end
|
1118
1118
|
|
data/lib/skeem/runtime.rb
CHANGED
@@ -35,6 +35,7 @@ module Skeem
|
|
35
35
|
def update_binding(aKey, anEntry)
|
36
36
|
environment.update_binding(aKey, anEntry)
|
37
37
|
end
|
38
|
+
# rubocop: disable Lint/UselessRescue
|
38
39
|
|
39
40
|
def evaluate(aKey)
|
40
41
|
key_value = normalize_key(aKey)
|
@@ -58,6 +59,7 @@ module Skeem
|
|
58
59
|
raise err, err_msg
|
59
60
|
end
|
60
61
|
end
|
62
|
+
# rubocop: enable Lint/UselessRescue
|
61
63
|
|
62
64
|
# @param aList[SkmPair] first member is an identifier.
|
63
65
|
def evaluate_form(aList)
|
data/lib/skeem/s_expr_nodes.rb
CHANGED
@@ -105,7 +105,7 @@ module Skeem
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def inspect
|
108
|
-
result =
|
108
|
+
result = "#{inspect_prefix}#{operator.inspect}, "
|
109
109
|
result << "@operands #{operands.inspect}#{inspect_suffix}"
|
110
110
|
result
|
111
111
|
end
|
@@ -146,6 +146,7 @@ module Skeem
|
|
146
146
|
end
|
147
147
|
|
148
148
|
# rubocop: disable Style/RedundantAssignment
|
149
|
+
# rubocop: disable Lint/UselessRescue
|
149
150
|
|
150
151
|
def fetch_callee(aRuntime, var_key)
|
151
152
|
begin
|
@@ -176,6 +177,7 @@ module Skeem
|
|
176
177
|
callee
|
177
178
|
end
|
178
179
|
|
180
|
+
# rubocop: enable Lint/UselessRescue
|
179
181
|
# rubocop: enable Style/RedundantAssignment
|
180
182
|
|
181
183
|
def transform_operands(aRuntime)
|
@@ -229,7 +231,7 @@ module Skeem
|
|
229
231
|
end
|
230
232
|
|
231
233
|
def inspect
|
232
|
-
result =
|
234
|
+
result = "#{inspect_prefix}@test #{test.inspect}, "
|
233
235
|
result << "@consequent #{consequent.inspect}, "
|
234
236
|
result << "@alternate #{alternate.inspect}#{inspect_suffix}"
|
235
237
|
result
|
@@ -277,7 +279,7 @@ module Skeem
|
|
277
279
|
consequent_qq = consequent.quasiquote(aRuntime)
|
278
280
|
[test_qq, consequent_qq]
|
279
281
|
end
|
280
|
-
quasi_alternate = alternate
|
282
|
+
quasi_alternate = alternate&.quasiquote(aRuntime)
|
281
283
|
|
282
284
|
self.class.new(position, quasi_clauses, quasi_alternate)
|
283
285
|
end
|