srl_ruby 0.4.12 → 0.4.14
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 +19 -328
- data/CHANGELOG.md +15 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -5
- data/bin/srl2ruby +1 -1
- data/lib/regex/abstract_method.rb +1 -1
- data/lib/regex/character.rb +2 -2
- data/lib/regex/match_option.rb +1 -1
- data/lib/srl_ruby/ast_builder.rb +1 -1
- data/lib/srl_ruby/tokenizer.rb +10 -10
- data/lib/srl_ruby/version.rb +1 -1
- data/lib/srl_ruby.rb +4 -4
- data/spec/acceptance/srl_test_suite_spec.rb +18 -18
- data/spec/acceptance/support/rule_file_tokenizer.rb +1 -2
- data/spec/regex/atomic_expression_spec.rb +13 -13
- data/spec/regex/character_spec.rb +39 -39
- data/spec/regex/match_option_spec.rb +10 -9
- data/spec/regex/monadic_expression_spec.rb +14 -13
- data/spec/regex/multiplicity_spec.rb +10 -10
- data/spec/regex/repetition_spec.rb +10 -9
- data/spec/srl_ruby/srl_ruby_spec.rb +1 -1
- data/spec/srl_ruby/tokenizer_spec.rb +45 -45
- data/spec/srl_ruby_spec.rb +129 -129
- data/srl_ruby.gemspec +2 -1
- metadata +6 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa7a9699a1a4f26e820e1523d4f6d3fa186cd814afeb5b41e164ea191df7303b
|
4
|
+
data.tar.gz: 0f4b1c7de0da2ed0a1acf1f2a700271d35afc383b5d9eeec0d790993f9d8928b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 972f392c2817101f0bffcc688b867060f19da7c258e5b0bd2fb2061a602df6d0c8f00df85be855bc6bb2cc24b8bd1c1994fac00d06a7ca9b1fe353277acbd21f
|
7
|
+
data.tar.gz: 7b8e2065d771a5ae84051bc7633d09ea6ed7dcb781b277fd47118b3796cf5a2f7f4d1fe44e29b5acf65303902e8c9a1b9b4f7692b8c9b4079c47115258450870
|
data/.rubocop.yml
CHANGED
@@ -2,12 +2,14 @@ AllCops:
|
|
2
2
|
Exclude:
|
3
3
|
- 'exp/**/*'
|
4
4
|
- 'demo/**/*'
|
5
|
+
NewCops: enable
|
6
|
+
SuggestExtensions: false
|
5
7
|
|
6
|
-
Gemspec/
|
7
|
-
|
8
|
+
Gemspec/DevelopmentDependencies:
|
9
|
+
EnforcedStyle: gemspec
|
8
10
|
|
9
11
|
Gemspec/RequireMFA: # new in 1.23
|
10
|
-
Enabled:
|
12
|
+
Enabled: true
|
11
13
|
|
12
14
|
Layout/ArgumentAlignment:
|
13
15
|
Enabled: false
|
@@ -47,136 +49,19 @@ Layout/HashAlignment:
|
|
47
49
|
Layout/IndentationWidth:
|
48
50
|
Enabled: false
|
49
51
|
|
50
|
-
Layout/IndentationConsistency:
|
51
|
-
Enabled: true
|
52
|
-
|
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
59
|
Lint/EmptyClass:
|
109
60
|
Enabled: false
|
110
61
|
|
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/UselessRuby2Keywords: # new in 1.23
|
172
|
-
Enabled: true
|
173
|
-
|
174
62
|
Lint/Void:
|
175
63
|
Enabled: false
|
176
64
|
|
177
|
-
Lint/UselessAssignment:
|
178
|
-
Enabled: true
|
179
|
-
|
180
65
|
Metrics/AbcSize:
|
181
66
|
Enabled: false
|
182
67
|
|
@@ -216,15 +101,6 @@ Naming/ConstantName:
|
|
216
101
|
Naming/ClassAndModuleCamelCase:
|
217
102
|
Enabled: false
|
218
103
|
|
219
|
-
Naming/BlockForwarding: # new in 1.24
|
220
|
-
Enabled: true
|
221
|
-
|
222
|
-
Naming/BlockParameterName:
|
223
|
-
Enabled: true
|
224
|
-
|
225
|
-
Naming/InclusiveLanguage:
|
226
|
-
Enabled: true
|
227
|
-
|
228
104
|
Naming/MethodParameterName:
|
229
105
|
Enabled: false
|
230
106
|
|
@@ -234,18 +110,6 @@ Naming/MethodName:
|
|
234
110
|
Naming/VariableName:
|
235
111
|
Enabled: false
|
236
112
|
|
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
113
|
Style/AsciiComments:
|
250
114
|
Enabled: false
|
251
115
|
|
@@ -279,9 +143,6 @@ Style/CommentedKeyword:
|
|
279
143
|
Style/ConditionalAssignment:
|
280
144
|
Enabled: false
|
281
145
|
|
282
|
-
Style/DefWithParentheses:
|
283
|
-
Enabled: true
|
284
|
-
|
285
146
|
Style/Documentation:
|
286
147
|
Enabled: false
|
287
148
|
|
@@ -291,222 +152,52 @@ Style/DocumentDynamicEvalDefinition:
|
|
291
152
|
Style/ExpandPathArguments:
|
292
153
|
Enabled: false
|
293
154
|
|
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
155
|
Style/GuardClause:
|
307
156
|
Enabled: false
|
308
157
|
|
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
158
|
Style/IfUnlessModifier:
|
322
159
|
Enabled: false
|
323
160
|
|
324
|
-
Style/InPatternThen:
|
325
|
-
Enabled: true
|
326
|
-
|
327
161
|
Style/InverseMethods:
|
328
162
|
Enabled: false
|
329
163
|
|
330
|
-
Style/MapToHash: # new in 1.24
|
331
|
-
Enabled: true
|
332
|
-
|
333
164
|
Style/MissingRespondToMissing:
|
334
165
|
Enabled: false
|
335
166
|
|
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
167
|
Style/Next:
|
346
168
|
Enabled: false
|
347
169
|
|
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
170
|
Style/NumericLiterals:
|
358
171
|
Enabled: false
|
359
172
|
|
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
173
|
Style/RegexpLiteral:
|
388
174
|
Enabled: false
|
389
175
|
|
390
176
|
Style/PercentLiteralDelimiters:
|
391
177
|
Enabled: false
|
392
178
|
|
393
|
-
Style/SelectByRegexp: # new in 1.22
|
394
|
-
Enabled: true
|
395
|
-
|
396
179
|
Style/StderrPuts:
|
397
180
|
Enabled: false
|
398
181
|
|
399
|
-
Style/StringLiterals:
|
400
|
-
Enabled: true
|
401
|
-
|
402
|
-
Style/SwapValues:
|
403
|
-
Enabled: true
|
404
|
-
|
405
182
|
Style/TernaryParentheses:
|
406
183
|
Enabled: false
|
407
184
|
|
408
185
|
Style/UnlessElse:
|
409
186
|
Enabled: false
|
410
187
|
|
411
|
-
#
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
Enabled: true
|
426
|
-
|
427
|
-
Lint/EmptyConditionalBody:
|
428
|
-
Enabled: true
|
429
|
-
|
430
|
-
Lint/FloatComparison:
|
431
|
-
Enabled: true
|
432
|
-
|
433
|
-
Lint/MissingSuper:
|
434
|
-
Enabled: true
|
435
|
-
|
436
|
-
Lint/MixedRegexpCaptureTypes:
|
437
|
-
Enabled: true
|
438
|
-
|
439
|
-
Lint/OutOfRangeRegexpRef:
|
440
|
-
Enabled: true
|
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
|
188
|
+
#RSpec/ContextWording:
|
189
|
+
# Enabled: false
|
190
|
+
#
|
191
|
+
#RSpec/ExampleLength:
|
192
|
+
# Max: 40
|
193
|
+
#
|
194
|
+
#RSpec/MultipleExpectations:
|
195
|
+
# Max: 15
|
196
|
+
#
|
197
|
+
#RSpec/NoExpectationExample:
|
198
|
+
# Enabled: false
|
199
|
+
#
|
200
|
+
#RSpec/RepeatedDescription:
|
201
|
+
# Enabled: false
|
468
202
|
|
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
203
|
|
511
|
-
Style/StringConcatenation:
|
512
|
-
Enabled: true
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## [0.4.13] - 2025-02-22
|
2
|
+
- Tested against rubocop-rspec 3.5.0
|
3
|
+
|
4
|
+
### Fixed
|
5
|
+
- Fixed most "offences" reported by rubocop-rspec
|
6
|
+
|
7
|
+
## [0.4.13] - 2025-02-22
|
8
|
+
- Tested against MRI Ruby 3.4.1
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
- Shortened `.rubocop.yml` file
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- Fixed all "offences" reported by Rubocop 1.72.2
|
15
|
+
|
1
16
|
## [0.4.12] - 2022-04-22
|
2
17
|
- Code refactoring.
|
3
18
|
|
data/LICENSE.txt
CHANGED
@@ -5,7 +5,7 @@ the 'srl_test' directory, which is subject to its own license.
|
|
5
5
|
|
6
6
|
The MIT License (MIT)
|
7
7
|
|
8
|
-
Copyright (c) 2018-
|
8
|
+
Copyright (c) 2018-2025 Dimitri Geshef
|
9
9
|
|
10
10
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
11
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -405,8 +405,4 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/famish
|
|
405
405
|
|
406
406
|
## License
|
407
407
|
|
408
|
-
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
409
|
-
|
410
|
-
## Code of Conduct
|
411
|
-
|
412
|
-
Everyone interacting in the SrlRuby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/srl_ruby/blob/master/CODE_OF_CONDUCT.md).
|
408
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/bin/srl2ruby
CHANGED
@@ -17,7 +17,7 @@ module AbstractMethod
|
|
17
17
|
# end
|
18
18
|
def abstract_method
|
19
19
|
# Determine the short class name of self
|
20
|
-
className = self.class.name.split(
|
20
|
+
className = self.class.name.split('::').last
|
21
21
|
|
22
22
|
# Retrieve the top text line of the call stack
|
23
23
|
top_line = caller(1..1)
|
data/lib/regex/character.rb
CHANGED
@@ -93,7 +93,7 @@ module Regex # This module is used as a namespace
|
|
93
93
|
aChar.ord
|
94
94
|
end
|
95
95
|
|
96
|
-
#
|
96
|
+
# Conversion method that returns the codepoint for the given escape
|
97
97
|
# sequence (a String).
|
98
98
|
# Recognized escaped characters are: \a (alarm, 0x07), \n (newline, 0xA),
|
99
99
|
# \r (carriage return, 0xD), \t (tab, 0x9), \e (escape, 0x1B), \f (form feed,
|
@@ -104,7 +104,7 @@ module Regex # This module is used as a namespace
|
|
104
104
|
# Example:
|
105
105
|
# RegAn::Character::esc2codepoint('\n') # Returns: 0xd
|
106
106
|
def self.esc2codepoint(esc_seq)
|
107
|
-
msg = "Escape sequence #{esc_seq} does not begin with a backslash (
|
107
|
+
msg = "Escape sequence #{esc_seq} does not begin with a backslash (\\)."
|
108
108
|
raise StandardError, msg unless esc_seq[0] == '\\'
|
109
109
|
|
110
110
|
(esc_seq.length == 2) ? digram2codepoint(esc_seq) : esc_number2codepoint(esc_seq)
|
data/lib/regex/match_option.rb
CHANGED
@@ -35,7 +35,7 @@ module Regex # This module is used as a namespace
|
|
35
35
|
return true if object_id == other.object_id
|
36
36
|
|
37
37
|
if other.kind_of?(MatchOption)
|
38
|
-
isEqual = (
|
38
|
+
isEqual = (flags == other.flags) && (child == other.child)
|
39
39
|
else
|
40
40
|
isEqual = false
|
41
41
|
end
|
data/lib/srl_ruby/ast_builder.rb
CHANGED
data/lib/srl_ruby/tokenizer.rb
CHANGED
@@ -17,15 +17,15 @@ module SrlRuby
|
|
17
17
|
# Delimiters: parentheses '(' and ')'
|
18
18
|
# Separators: comma (optional)
|
19
19
|
class Tokenizer
|
20
|
-
PATT_CHAR_CLASS = /[^,"\s]{2,}
|
21
|
-
PATT_DIGIT_LIT = /[0-9]((?=\s|,|\))|$)
|
22
|
-
PATT_IDENTIFIER = /[a-zA-Z_][a-zA-Z0-9_]
|
23
|
-
PATT_INTEGER = /[0-9]{2,}((?=\s|,|\))|$)
|
24
|
-
PATT_LETTER_LIT = /[a-zA-Z]((?=\s|,|\))|$)
|
25
|
-
PATT_NEWLINE = /(?:\r\n)|\r|\n
|
26
|
-
PATT_STR_DBL_QUOTE = /"(?:\\"|[^"])*"
|
27
|
-
PATT_STR_SNGL_QUOTE = /'(?:\\'|[^'])*'
|
28
|
-
PATT_WHITESPACE = /[ \t\f]
|
20
|
+
PATT_CHAR_CLASS = /[^,"\s]{2,}/
|
21
|
+
PATT_DIGIT_LIT = /[0-9]((?=\s|,|\))|$)/
|
22
|
+
PATT_IDENTIFIER = /[a-zA-Z_][a-zA-Z0-9_]+/
|
23
|
+
PATT_INTEGER = /[0-9]{2,}((?=\s|,|\))|$)/ # An integer has 2..* digits
|
24
|
+
PATT_LETTER_LIT = /[a-zA-Z]((?=\s|,|\))|$)/
|
25
|
+
PATT_NEWLINE = /(?:\r\n)|\r|\n/
|
26
|
+
PATT_STR_DBL_QUOTE = /"(?:\\"|[^"])*"/ # Double quotes literal?
|
27
|
+
PATT_STR_SNGL_QUOTE = /'(?:\\'|[^'])*'/ # Single quotes literal?
|
28
|
+
PATT_WHITESPACE = /[ \t\f]+/
|
29
29
|
|
30
30
|
# @return [StringScanner]
|
31
31
|
attr_reader(:scanner)
|
@@ -100,7 +100,7 @@ module SrlRuby
|
|
100
100
|
WHITESPACE
|
101
101
|
WITH
|
102
102
|
WORD
|
103
|
-
].
|
103
|
+
].to_h { |x| [x, x] }
|
104
104
|
|
105
105
|
class ScanError < StandardError; end
|
106
106
|
|
data/lib/srl_ruby/version.rb
CHANGED
data/lib/srl_ruby.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative '
|
4
|
-
require_relative '
|
5
|
-
require_relative '
|
6
|
-
require_relative '
|
3
|
+
require_relative 'srl_ruby/version'
|
4
|
+
require_relative 'srl_ruby/tokenizer'
|
5
|
+
require_relative 'srl_ruby/grammar'
|
6
|
+
require_relative 'srl_ruby/ast_builder'
|
7
7
|
|
8
8
|
module SrlRuby
|
9
9
|
# Compile the SRL expression in given filename into a Regexp object.
|