srl_ruby 0.4.9 → 0.4.10
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32a18d724b0eaeff828ffc7fa2413834ea9e16dd1c46a06af7d5438c56fec159
|
4
|
+
data.tar.gz: 628b07343fdd3da4a2903b48b392ce6b52880e68ad0f229efd0d702abe3a90df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 376fa359b54c5f5434c70ca9d855d718bfb933e30c5cdf29409f23ee3113659577b5680c073e091ca42c7e3ed0c68836ed9120fb93aa3d2be1a78cdcae08d8fb
|
7
|
+
data.tar.gz: 256f800715bc35d61cf134cddb91f199455357712e5f197d271e7efaebb6e745c66970d4a02935dd6f6779f22eb9309af744f0de47e78226bed924ae22885847
|
data/lib/srl_ruby/version.rb
CHANGED
@@ -32,7 +32,7 @@ module Acceptance
|
|
32
32
|
Terminal2NodeClass
|
33
33
|
end
|
34
34
|
|
35
|
-
# rule('rule_file' =>
|
35
|
+
# rule('rule_file' => 'srl_heading tests').as 'start_rule'
|
36
36
|
def reduce_start_rule(_production, _range, _tokens, theChildren)
|
37
37
|
rule_file = RuleFileTests.new(theChildren[0])
|
38
38
|
tests = theChildren.last.flatten
|
@@ -54,16 +54,6 @@ module Acceptance
|
|
54
54
|
theChildren.last
|
55
55
|
end
|
56
56
|
|
57
|
-
# rule('srl_tests' => %w[srl_tests single_test]).as 'test_list'
|
58
|
-
def reduce_test_list(_production, _range, _tokens, theChildren)
|
59
|
-
theChildren[0] << theChildren[1]
|
60
|
-
end
|
61
|
-
|
62
|
-
# rule('srl_tests' => 'single_test').as 'one_test'
|
63
|
-
def reduce_one_test(_production, _range, _tokens, theChildren)
|
64
|
-
[theChildren.last]
|
65
|
-
end
|
66
|
-
|
67
57
|
# rule('match_test' => %w[MATCH: STRING_LIT]).as 'match_string'
|
68
58
|
def reduce_match_string(_production, _range, _tokens, theChildren)
|
69
59
|
MatchTest.new(theChildren.last)
|
@@ -85,17 +75,6 @@ module Acceptance
|
|
85
75
|
theChildren[2]
|
86
76
|
end
|
87
77
|
|
88
|
-
# rule('capture_expectations' => %w[capture_expectations
|
89
|
-
# single_expectation]).as 'assertion_list'
|
90
|
-
def reduce_assertion_list(_production, _range, _tokens, theChildren)
|
91
|
-
theChildren[0] << theChildren[1]
|
92
|
-
end
|
93
|
-
|
94
|
-
# rule('capture_expectations' => 'single_expectation').as 'one_expectation'
|
95
|
-
def reduce_one_expectation(_production, _range, _tokens, theChildren)
|
96
|
-
[theChildren.last]
|
97
|
-
end
|
98
|
-
|
99
78
|
# rule('single_expectation' => %w[DASH INTEGER COLON capture_variable
|
100
79
|
# COLON STRING_LIT]).as 'capture_expectation'
|
101
80
|
def reduce_capture_expectation(_production, _range, _tokens, theChildren)
|
@@ -6,7 +6,6 @@ require 'rley' # Load the Rley gem
|
|
6
6
|
# Grammar for Test-Rule files
|
7
7
|
# [File format](https://github.com/SimpleRegex/Test-Rules/blob/master/README.md)
|
8
8
|
########################################
|
9
|
-
# Define a grammar for basic arithmetical expressions
|
10
9
|
builder = Rley::grammar_builder do
|
11
10
|
# Punctuation
|
12
11
|
add_terminals('COLON', 'DASH')
|
@@ -19,24 +18,20 @@ builder = Rley::grammar_builder do
|
|
19
18
|
add_terminals('INTEGER', 'STRING_LIT')
|
20
19
|
add_terminals('IDENTIFIER', 'SRL_SOURCE')
|
21
20
|
|
22
|
-
rule('rule_file' => 'srl_heading
|
23
|
-
rule('srl_heading' => 'SRL SRL_SOURCE').
|
24
|
-
rule('
|
25
|
-
rule('
|
26
|
-
rule('
|
27
|
-
rule('
|
28
|
-
rule('
|
29
|
-
rule('
|
30
|
-
rule('
|
31
|
-
rule('
|
32
|
-
rule('
|
33
|
-
rule('
|
34
|
-
rule('
|
35
|
-
rule('
|
36
|
-
rule('capture_expectations' => 'single_expectation').as 'one_expectation'
|
37
|
-
rule('single_expectation' => 'DASH INTEGER COLON capture_variable COLON STRING_LIT').as 'capture_expectation'
|
38
|
-
rule('capture_variable' => 'INTEGER').as 'var_integer'
|
39
|
-
rule('capture_variable' => 'IDENTIFIER').as 'var_identifier'
|
21
|
+
rule('rule_file' => 'srl_heading srl_test+').tag 'start_rule'
|
22
|
+
rule('srl_heading' => 'SRL SRL_SOURCE').tag 'srl_source'
|
23
|
+
rule('srl_test' => 'atomic_test').tag 'single_atomic_test'
|
24
|
+
rule('srl_test' => 'compound_test').tag 'single_compound_test'
|
25
|
+
rule('atomic_test' => 'match_test').tag 'atomic_match'
|
26
|
+
rule('atomic_test' => 'no_match_test').tag 'atomic_no_match'
|
27
|
+
rule('compound_test' => 'capture_test').tag 'compound_capture'
|
28
|
+
rule('match_test' => 'MATCH STRING_LIT').tag 'match_string'
|
29
|
+
rule('no_match_test' => 'NO MATCH STRING_LIT').tag 'no_match_string'
|
30
|
+
rule('capture_test' => 'capture_heading capture_expectation+').tag 'capture_test'
|
31
|
+
rule('capture_heading' => 'CAPTURE FOR STRING_LIT COLON').tag 'capture_string'
|
32
|
+
rule('capture_expectation' => 'DASH INTEGER COLON capture_variable COLON STRING_LIT').tag 'capture_expectation'
|
33
|
+
rule('capture_variable' => 'INTEGER').tag 'var_integer'
|
34
|
+
rule('capture_variable' => 'IDENTIFIER').tag 'var_identifier'
|
40
35
|
end
|
41
36
|
|
42
37
|
# And now build the grammar...
|