regexp_parser 0.3.4 → 0.3.5

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 +6 -0
  3. data/lib/regexp_parser/syntax/ruby/1.9.1.rb +1 -1
  4. data/lib/regexp_parser/syntax/tokens/escape.rb +2 -0
  5. data/lib/regexp_parser/version.rb +1 -1
  6. data/test/expression/test_base.rb +32 -34
  7. data/test/expression/test_clone.rb +49 -47
  8. data/test/expression/test_conditionals.rb +40 -40
  9. data/test/expression/test_free_space.rb +4 -2
  10. data/test/expression/test_set.rb +16 -16
  11. data/test/expression/test_strfregexp.rb +74 -74
  12. data/test/expression/test_subexpression.rb +2 -2
  13. data/test/expression/test_tests.rb +57 -57
  14. data/test/expression/test_to_h.rb +11 -6
  15. data/test/expression/test_to_s.rb +22 -15
  16. data/test/expression/test_traverse.rb +26 -29
  17. data/test/lexer/test_all.rb +9 -7
  18. data/test/lexer/test_conditionals.rb +35 -11
  19. data/test/lexer/test_keep.rb +6 -6
  20. data/test/lexer/test_literals.rb +20 -10
  21. data/test/lexer/test_nesting.rb +14 -7
  22. data/test/lexer/test_refcalls.rb +12 -5
  23. data/test/parser/test_all.rb +15 -13
  24. data/test/parser/test_alternation.rb +29 -26
  25. data/test/parser/test_anchors.rb +7 -8
  26. data/test/parser/test_conditionals.rb +43 -41
  27. data/test/parser/test_escapes.rb +18 -16
  28. data/test/parser/test_free_space.rb +33 -33
  29. data/test/parser/test_groups.rb +46 -46
  30. data/test/parser/test_keep.rb +4 -4
  31. data/test/parser/test_properties.rb +18 -16
  32. data/test/parser/test_quantifiers.rb +184 -163
  33. data/test/parser/test_refcalls.rb +48 -32
  34. data/test/parser/test_sets.rb +102 -88
  35. data/test/parser/test_types.rb +7 -8
  36. data/test/scanner/test_all.rb +6 -4
  37. data/test/scanner/test_anchors.rb +8 -5
  38. data/test/scanner/test_conditionals.rb +38 -20
  39. data/test/scanner/test_escapes.rb +8 -6
  40. data/test/scanner/test_free_space.rb +89 -65
  41. data/test/scanner/test_groups.rb +27 -32
  42. data/test/scanner/test_keep.rb +24 -22
  43. data/test/scanner/test_literals.rb +11 -7
  44. data/test/scanner/test_meta.rb +11 -7
  45. data/test/scanner/test_properties.rb +16 -14
  46. data/test/scanner/test_quantifiers.rb +8 -9
  47. data/test/scanner/test_refcalls.rb +26 -23
  48. data/test/scanner/test_scripts.rb +11 -10
  49. data/test/scanner/test_sets.rb +8 -5
  50. data/test/scanner/test_types.rb +17 -15
  51. data/test/scanner/test_unicode_blocks.rb +11 -10
  52. data/test/syntax/ruby/test_1.8.rb +4 -8
  53. data/test/syntax/ruby/test_1.9.1.rb +1 -7
  54. data/test/syntax/ruby/test_1.9.3.rb +3 -7
  55. data/test/syntax/ruby/test_2.0.0.rb +1 -7
  56. data/test/syntax/ruby/test_2.2.0.rb +1 -7
  57. data/test/token/test_token.rb +29 -31
  58. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3cfa8eca93da452bed80baa13cb98349eca9dcf
4
- data.tar.gz: 8a60f4b22945ab450723a9aac0443a9d2ae9bb3d
3
+ metadata.gz: ed3e75e40ac66c7485636e6fe3b0c63b8d3d3aa5
4
+ data.tar.gz: d72567776c9934caa47fe2ecb503855e3c45b70d
5
5
  SHA512:
6
- metadata.gz: ad557e665cf6bfa3a5adb025c1fd44756213579427f99e2c47e38ca2de95edc1c068ef5d0328c3c7d6522f8f0a268a85cd5348884f7f6652c3db4e580c31f4a7
7
- data.tar.gz: 2eed59b10fd17a36d41cf3ae702b5fcb54303c050c46884dc2a4bda3a745531fc4870a9afd254dfc69aaab48cf36683797dcaa550426b464ccb3cd705f4da965
6
+ metadata.gz: 624065b3e707c4869ed67012bde66544d6682b577f826f7089090a070c46bc4e7f4895efabb665cd8b797f5616dc2151c7a820a5b84ae3a88ac242a3737f846f
7
+ data.tar.gz: 6b745fc5a79f260879e4415077e9754f19cb8db608132a5892833dfe5ba85f56c15b5ba3c33cc7c203ff6277cc8ded82beded0996b6376a065a210a593082583
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ Mon May 30 2016 Ammar Ali <ammarabuali@gmail.com>
2
+
3
+ * Thanks to John Backus (https://github.com/backus):
4
+ - Fix parsing of /\xFF/n (hex:escape) (PR #24)
5
+ * Bumped version to 0.3.5
6
+
1
7
  Wed May 25 2016 Ammar Ali <ammarabuali@gmail.com>
2
8
 
3
9
  * Thanks to John Backus (https://github.com/backus):
@@ -15,7 +15,7 @@ module Regexp::Syntax
15
15
  implements :backref, Backreference::All +
16
16
  SubexpressionCall::All
17
17
 
18
- implements :escape, Escape::Unicode
18
+ implements :escape, Escape::Unicode + Escape::Hex
19
19
 
20
20
  implements :type, CharacterType::Hex
21
21
 
@@ -21,6 +21,8 @@ module Regexp::Syntax
21
21
  :set_open, :set_close,
22
22
  :baclslash]
23
23
 
24
+ Hex = [:hex]
25
+
24
26
  All = Basic + Backreference + ASCII + Meta
25
27
  Type = :escape
26
28
  end
@@ -1,5 +1,5 @@
1
1
  class Regexp
2
2
  module Parser
3
- VERSION = '0.3.4'
3
+ VERSION = '0.3.5'
4
4
  end
5
5
  end
@@ -7,10 +7,10 @@ class ExpressionBase < Test::Unit::TestCase
7
7
 
8
8
  re = RP.parse(re_text).to_re
9
9
 
10
- assert( re.is_a?(::Regexp),
11
- 'Not a Regexp, but should be')
10
+ assert re.is_a?(::Regexp),
11
+ 'Not a Regexp, but should be'
12
12
 
13
- assert_equal( re.source, re_text )
13
+ assert_equal re.source, re_text
14
14
  end
15
15
 
16
16
  def test_expression_level
@@ -18,51 +18,51 @@ class ExpressionBase < Test::Unit::TestCase
18
18
  root = RP.parse(regexp)
19
19
 
20
20
  %w{^ a (b(c(d))) e $}.each_with_index do |t, i|
21
- assert_equal( t, root[i].to_s )
22
- assert_equal( 0, root[i].level )
21
+ assert_equal t, root[i].to_s
22
+ assert_equal 0, root[i].level
23
23
  end
24
24
 
25
- assert_equal( 'b', root[2][0].to_s )
26
- assert_equal( 1, root[2][0].level )
25
+ assert_equal 'b', root[2][0].to_s
26
+ assert_equal 1, root[2][0].level
27
27
 
28
- assert_equal( 'c', root[2][1][0].to_s )
29
- assert_equal( 2, root[2][1][0].level )
28
+ assert_equal 'c', root[2][1][0].to_s
29
+ assert_equal 2, root[2][1][0].level
30
30
 
31
- assert_equal( 'd', root[2][1][1][0].to_s )
32
- assert_equal( 3, root[2][1][1][0].level )
31
+ assert_equal 'd', root[2][1][1][0].to_s
32
+ assert_equal 3, root[2][1][1][0].level
33
33
  end
34
34
 
35
35
  def test_expression_terminal?
36
36
  root = RP.parse('^a([b]+)c$')
37
37
 
38
- assert_equal( false, root.terminal? )
38
+ assert_equal false, root.terminal?
39
39
 
40
- assert_equal( true, root[0].terminal? )
41
- assert_equal( true, root[1].terminal? )
42
- assert_equal( false, root[2].terminal? )
43
- assert_equal( true, root[2][0].terminal? )
44
- assert_equal( true, root[3].terminal? )
45
- assert_equal( true, root[4].terminal? )
40
+ assert_equal true, root[0].terminal?
41
+ assert_equal true, root[1].terminal?
42
+ assert_equal false, root[2].terminal?
43
+ assert_equal true, root[2][0].terminal?
44
+ assert_equal true, root[3].terminal?
45
+ assert_equal true, root[4].terminal?
46
46
  end
47
47
 
48
48
  def test_expression_alt_terminal?
49
49
  root = RP.parse('^(ab|cd)$')
50
50
 
51
- assert_equal( false, root.terminal? )
51
+ assert_equal false, root.terminal?
52
52
 
53
- assert_equal( true, root[0].terminal? )
54
- assert_equal( false, root[1].terminal? )
55
- assert_equal( false, root[1][0].terminal? )
56
- assert_equal( false, root[1][0][0].terminal? )
57
- assert_equal( true, root[1][0][0][0].terminal? )
58
- assert_equal( false, root[1][0][1].terminal? )
59
- assert_equal( true, root[1][0][1][0].terminal? )
53
+ assert_equal true, root[0].terminal?
54
+ assert_equal false, root[1].terminal?
55
+ assert_equal false, root[1][0].terminal?
56
+ assert_equal false, root[1][0][0].terminal?
57
+ assert_equal true, root[1][0][0][0].terminal?
58
+ assert_equal false, root[1][0][1].terminal?
59
+ assert_equal true, root[1][0][1][0].terminal?
60
60
  end
61
61
 
62
62
  def test_expression_coded_offset
63
63
  root = RP.parse('^a*(b+(c?))$')
64
64
 
65
- assert_equal( '@0+12', root.coded_offset )
65
+ assert_equal '@0+12', root.coded_offset
66
66
 
67
67
  # All top level offsets
68
68
  checks = [
@@ -72,20 +72,18 @@ class ExpressionBase < Test::Unit::TestCase
72
72
  ['@11+1', '$' ],
73
73
  ].each_with_index do |check, i|
74
74
  against = [ root[i].coded_offset, root[i].to_s ]
75
- assert_equal( check, against )
75
+
76
+ assert_equal check, against
76
77
  end
77
78
 
78
79
  # Nested expression
79
- assert_equal(['@4+2', 'b+'],
80
- [root[2][0].coded_offset, root[2][0].to_s])
80
+ assert_equal ['@4+2', 'b+'], [root[2][0].coded_offset, root[2][0].to_s]
81
81
 
82
82
  # Nested subexpression
83
- assert_equal(['@6+4', '(c?)'],
84
- [root[2][1].coded_offset, root[2][1].to_s])
83
+ assert_equal ['@6+4', '(c?)'], [root[2][1].coded_offset, root[2][1].to_s]
85
84
 
86
85
  # Nested subexpression expression
87
- assert_equal(['@7+2', 'c?'],
88
- [root[2][1][0].coded_offset, root[2][1][0].to_s])
86
+ assert_equal ['@7+2', 'c?'], [root[2][1][0].coded_offset, root[2][1][0].to_s]
89
87
  end
90
88
 
91
89
  end
@@ -6,57 +6,57 @@ class ExpressionClone < Test::Unit::TestCase
6
6
  root = RP.parse(/^(?i:a)b+$/i)
7
7
  copy = root.clone
8
8
 
9
- assert_not_equal(copy.object_id, root.object_id)
9
+ refute_equal copy.object_id, root.object_id
10
10
 
11
11
  # The text content is equal but the objects are not.
12
- assert_equal(copy.text, root.text)
13
- assert_not_equal(copy.text.object_id, root.text.object_id)
12
+ assert_equal copy.text, root.text
13
+ refute_equal copy.text.object_id, root.text.object_id
14
14
 
15
15
  root_1 = root.expressions[1]
16
16
  copy_1 = copy.expressions[1]
17
17
 
18
18
  # The options hash contents are equal but the objects are not.
19
- assert_equal(copy_1.options, root_1.options)
20
- assert_not_equal(copy_1.options.object_id,
21
- root_1.options.object_id)
19
+ assert_equal copy_1.options, root_1.options
20
+ refute_equal copy_1.options.object_id, root_1.options.object_id
22
21
 
23
22
  root_2 = root.expressions[2]
24
23
  copy_2 = copy.expressions[2]
25
24
 
26
- assert( root_2.quantified? )
27
- assert( copy_2.quantified? )
25
+ assert root_2.quantified?
26
+ assert copy_2.quantified?
28
27
 
29
28
  # The quantifier contents are equal but the objects are not.
30
- assert_equal(copy_2.quantifier.text, root_2.quantifier.text)
29
+ assert_equal copy_2.quantifier.text,
30
+ root_2.quantifier.text
31
31
 
32
- assert_not_equal(copy_2.quantifier.text.object_id,
33
- root_2.quantifier.text.object_id)
32
+ refute_equal copy_2.quantifier.text.object_id,
33
+ root_2.quantifier.text.object_id
34
34
 
35
- assert_not_equal(copy_2.quantifier.object_id,
36
- root_2.quantifier.object_id)
35
+ refute_equal copy_2.quantifier.object_id,
36
+ root_2.quantifier.object_id
37
37
  end
38
38
 
39
39
  def test_expression_clone_subexpression
40
40
  root = RP.parse(/^a(b([cde])f)g$/)
41
41
  copy = root.clone
42
42
 
43
- assert( root.respond_to?(:expressions) )
44
- assert( copy.respond_to?(:expressions) )
43
+ assert root.respond_to?(:expressions)
44
+ assert copy.respond_to?(:expressions)
45
45
 
46
46
  # The expressions arrays are not equal.
47
- assert_not_equal(copy.expressions.object_id,
48
- root.expressions.object_id)
47
+ refute_equal copy.expressions.object_id,
48
+ root.expressions.object_id
49
49
 
50
50
  # The expressions in the arrays are not equal.
51
- copy.expressions.each_with_index do |e, ei|
52
- assert_not_equal(e.object_id,
53
- root.expressions[ei].object_id)
51
+ copy.expressions.each_with_index do |exp, index|
52
+ refute_equal exp.object_id,
53
+ root.expressions[index].object_id
54
54
  end
55
55
 
56
56
  # The expressions in nested expressions are not equal.
57
- copy.expressions[2].each_with_index do |e, ei|
58
- assert_not_equal(e.object_id,
59
- root.expressions[2][ei].object_id)
57
+ copy.expressions[2].each_with_index do |exp, index|
58
+ refute_equal exp.object_id,
59
+ root.expressions[2][index].object_id
60
60
  end
61
61
  end
62
62
 
@@ -69,21 +69,20 @@ class ExpressionClone < Test::Unit::TestCase
69
69
  copy_1 = copy.expressions[1]
70
70
 
71
71
  # The names are equal but their objects are not.
72
- assert_equal(copy_1.name, root_1.name)
73
- assert_not_equal(copy_1.name.object_id,
74
- root_1.name.object_id)
72
+ assert_equal copy_1.name, root_1.name
73
+ refute_equal copy_1.name.object_id, root_1.name.object_id
75
74
 
76
75
  # Verify super: text objects should be different.
77
- assert_equal(copy_1.text, root_1.text)
76
+ assert_equal copy_1.text, root_1.text
78
77
 
79
78
  # Verify super: expressions arrays are not equal.
80
- assert_not_equal(copy_1.expressions.object_id,
81
- root_1.expressions.object_id)
79
+ refute_equal copy_1.expressions.object_id,
80
+ root_1.expressions.object_id
82
81
 
83
82
  # Verify super: expressions in the arrays are not equal.
84
- copy_1.expressions.each_with_index do |e, ei|
85
- assert_not_equal(e.object_id,
86
- root_1.expressions[ei].object_id)
83
+ copy_1.expressions.each_with_index do |exp, index|
84
+ refute_equal exp.object_id,
85
+ root_1.expressions[index].object_id
87
86
  end
88
87
  end
89
88
 
@@ -93,15 +92,17 @@ class ExpressionClone < Test::Unit::TestCase
93
92
 
94
93
  root_2_1 = root.expressions[2][1]
95
94
 
96
- copy.expressions[2][1].each_with_index do |e, ei|
97
- assert( e.respond_to?(:members) )
95
+ copy.expressions[2][1].each_with_index do |exp, index|
96
+ assert exp.respond_to?(:members)
98
97
 
99
98
  # The members arrays are not equal.
100
- assert_not_equal( e.members.object_id, root_2_1[ei].members.object_id )
99
+ refute_equal exp.members.object_id,
100
+ root_2_1[index].members.object_id
101
101
 
102
102
  # The members in the arrays are not equal.
103
- e.members.each_with_index do |m, mi|
104
- assert_not_equal( m.object_id, root_2_1[ei].members[mi].object_id )
103
+ exp.members.each_with_index do |member, member_index|
104
+ refute_equal member.object_id,
105
+ root_2_1[index].members[member_index].object_id
105
106
  end
106
107
  end
107
108
  end
@@ -119,25 +120,26 @@ class ExpressionClone < Test::Unit::TestCase
119
120
  copy_subset = copy_set.members[1]
120
121
 
121
122
  # Sanity checks
122
- assert( root_set.respond_to?(:members) )
123
- assert( copy_set.respond_to?(:members) )
123
+ assert root_set.respond_to?(:members)
124
+ assert copy_set.respond_to?(:members)
124
125
 
125
- assert( root_subset.respond_to?(:members) )
126
- assert( copy_subset.respond_to?(:members) )
126
+ assert root_subset.respond_to?(:members)
127
+ assert copy_subset.respond_to?(:members)
127
128
 
128
129
  # The sets are not equal
129
- assert_not_equal(copy_set.object_id, root_set.object_id)
130
+ refute_equal copy_set.object_id, root_set.object_id
130
131
 
131
132
  # The subsets are not equal
132
- assert_not_equal(copy_subset.object_id, root_subset.object_id)
133
+ refute_equal copy_subset.object_id, root_subset.object_id
133
134
 
134
135
  # The subsets' members arrays are not equal.
135
- assert_not_equal( copy_subset.members.object_id,
136
- root_subset.members.object_id )
136
+ refute_equal copy_subset.members.object_id,
137
+ root_subset.members.object_id
137
138
 
138
139
  # The subsets' members are not equal
139
- copy_subset.members.each_with_index do |m, mi|
140
- assert_not_equal(m.object_id, root_subset.members[mi].object_id)
140
+ copy_subset.members.each_with_index do |member, member_index|
141
+ refute_equal member.object_id,
142
+ root_subset.members[member_index].object_id
141
143
  end
142
144
  end
143
145
 
@@ -20,13 +20,13 @@ class ExpressionConditionals < Test::Unit::TestCase
20
20
 
21
21
  def test_expression_conditional_root_level
22
22
  %w{^ a (b(?(1)c|(?(2)d|(?(3)e|f)))g) $}.each_with_index do |t, i|
23
- assert_equal( 0, @root[i].conditional_level )
24
- assert_equal( t, @root[i].to_s )
23
+ assert_equal 0, @root[i].conditional_level
24
+ assert_equal t, @root[i].to_s
25
25
  end
26
26
 
27
27
  # First capture group
28
- assert_equal( 'b', @root[2][0].text )
29
- assert_equal( 0, @root[2][0].conditional_level )
28
+ assert_equal 'b', @root[2][0].text
29
+ assert_equal 0, @root[2][0].conditional_level
30
30
  end
31
31
 
32
32
  def test_expression_conditional_level_one
@@ -35,18 +35,18 @@ class ExpressionConditionals < Test::Unit::TestCase
35
35
  branch_2 = @cond_1.branches.last
36
36
 
37
37
  # Condition
38
- assert_equal( true, is_conditional_condition?(condition) )
39
- assert_equal( '(1)', condition.text )
40
- assert_equal( 1, condition.conditional_level )
38
+ assert_equal true, is_conditional_condition?(condition)
39
+ assert_equal '(1)', condition.text
40
+ assert_equal 1, condition.conditional_level
41
41
 
42
42
  # Branch 1
43
- assert_equal( true, is_conditional_branch?(branch_1) )
44
- assert_equal( 'c', branch_1.text )
45
- assert_equal( 1, branch_1.conditional_level )
43
+ assert_equal true, is_conditional_branch?(branch_1)
44
+ assert_equal 'c', branch_1.text
45
+ assert_equal 1, branch_1.conditional_level
46
46
 
47
47
  # Literal
48
- assert_equal( 'c', branch_1.first.text )
49
- assert_equal( 1, branch_1.first.conditional_level )
48
+ assert_equal 'c', branch_1.first.text
49
+ assert_equal 1, branch_1.first.conditional_level
50
50
 
51
51
  end
52
52
 
@@ -55,26 +55,26 @@ class ExpressionConditionals < Test::Unit::TestCase
55
55
  branch_1 = @cond_2.branches.first
56
56
  branch_2 = @cond_2.branches.last
57
57
 
58
- assert_equal( '(?', @cond_2.text )
59
- assert_equal( 1, @cond_2.conditional_level )
58
+ assert_equal '(?', @cond_2.text
59
+ assert_equal 1, @cond_2.conditional_level
60
60
 
61
61
  # Condition
62
- assert_equal( true, is_conditional_condition?(condition) )
63
- assert_equal( '(2)', condition.text )
64
- assert_equal( 2, condition.conditional_level )
62
+ assert_equal true, is_conditional_condition?(condition)
63
+ assert_equal '(2)', condition.text
64
+ assert_equal 2, condition.conditional_level
65
65
 
66
66
  # Branch 1
67
- assert_equal( true, is_conditional_branch?(branch_1) )
68
- assert_equal( 'd', branch_1.text )
69
- assert_equal( 2, branch_1.conditional_level )
67
+ assert_equal true, is_conditional_branch?(branch_1)
68
+ assert_equal 'd', branch_1.text
69
+ assert_equal 2, branch_1.conditional_level
70
70
 
71
71
  # Literal
72
- assert_equal( 'd', branch_1.first.text )
73
- assert_equal( 2, branch_1.first.conditional_level )
72
+ assert_equal 'd', branch_1.first.text
73
+ assert_equal 2, branch_1.first.conditional_level
74
74
 
75
75
  # Branch 2
76
- assert_equal( '(?', branch_2.first.text )
77
- assert_equal( 2, branch_2.first.conditional_level )
76
+ assert_equal '(?', branch_2.first.text
77
+ assert_equal 2, branch_2.first.conditional_level
78
78
  end
79
79
 
80
80
  def test_expression_conditional_level_three
@@ -83,32 +83,32 @@ class ExpressionConditionals < Test::Unit::TestCase
83
83
  branch_2 = @cond_3.branches.last
84
84
 
85
85
  # Condition
86
- assert_equal( true, is_conditional_condition?(condition) )
87
- assert_equal( '(3)', condition.text )
88
- assert_equal( 3, condition.conditional_level )
86
+ assert_equal true, is_conditional_condition?(condition)
87
+ assert_equal '(3)', condition.text
88
+ assert_equal 3, condition.conditional_level
89
89
 
90
90
  # Same as branch 2 in level two
91
- assert_equal( '(?', @cond_3.text )
92
- assert_equal( '(?(3)e|f)', @cond_3.to_s )
93
- assert_equal( 2, @cond_3.conditional_level )
91
+ assert_equal '(?', @cond_3.text
92
+ assert_equal '(?(3)e|f)', @cond_3.to_s
93
+ assert_equal 2, @cond_3.conditional_level
94
94
 
95
95
  # Branch 1
96
- assert_equal( true, is_conditional_branch?(branch_1) )
97
- assert_equal( 'e', branch_1.text )
98
- assert_equal( 3, branch_1.conditional_level )
96
+ assert_equal true, is_conditional_branch?(branch_1)
97
+ assert_equal 'e', branch_1.text
98
+ assert_equal 3, branch_1.conditional_level
99
99
 
100
100
  # Literal
101
- assert_equal( 'e', branch_1.first.text )
102
- assert_equal( 3, branch_1.first.conditional_level )
101
+ assert_equal 'e', branch_1.first.text
102
+ assert_equal 3, branch_1.first.conditional_level
103
103
 
104
104
  # Branch 2
105
- assert_equal( true, is_conditional_branch?(branch_2) )
106
- assert_equal( 'f', branch_2.text )
107
- assert_equal( 3, branch_2.conditional_level )
105
+ assert_equal true, is_conditional_branch?(branch_2)
106
+ assert_equal 'f', branch_2.text
107
+ assert_equal 3, branch_2.conditional_level
108
108
 
109
109
  # Literal
110
- assert_equal( 'f', branch_2.first.text )
111
- assert_equal( 3, branch_2.first.conditional_level )
110
+ assert_equal 'f', branch_2.first.text
111
+ assert_equal 3, branch_2.first.conditional_level
112
112
  end
113
113
 
114
114
  end