equation 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/equation_grammar.rb +70 -62
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc3a0622cdb38f0db990030f8ec8b9c70fec671e1dbe5d26167787e272ed4bbc
4
- data.tar.gz: 1c4ca3a83d2cb17b0fb954f84ed53ae6f919aef866a05cb87ea219092cf13165
3
+ metadata.gz: 53d1c83fe0fc09f8b53b716aa8cc1f687f3040519db6c52e448c7bdb733f7994
4
+ data.tar.gz: 5ba7d927c960fb443f04943ee15d4e10dc2ac6adc2738a341c512947363fbf5e
5
5
  SHA512:
6
- metadata.gz: edf2c16a123be3141a6757b95423fae213ee3b5028f48ea00fab72a75cb5bf1bd3d19ba4f7509466b9f8bfc4a5f572e0781beff8d5d152dc9b7d0d9e660dff8d
7
- data.tar.gz: e3d07dc903426b9d718b0cd4d32cfefd08e2eeb09ab5069079fc95100302a74f0ae526a96d618827810d4834a0cbe5e98f7371b43ef20916f264f3aba423a109
6
+ metadata.gz: 47dae82304f39aa3f198f8cbb310c76a31176bf048cba00c4d8985dc4a2650bd4bd5570668ec570fb39720d9dbde27b327a71b8f1a0a4e6ee04a37ae19cc3623
7
+ data.tar.gz: 8ba44fd1839addcf2979b0391bc09de22448fdc8d12c3291f4921167ac6ad6e63c1c39826aa79dc6fc58b734704f80c7d4ba6449be0c39a74c070f04b794960f
@@ -71,17 +71,21 @@ module Equation
71
71
  end
72
72
 
73
73
  module Logical1
74
- def lhs
74
+ def space1
75
75
  elements[0]
76
76
  end
77
77
 
78
- def space
78
+ def lhs
79
79
  elements[1]
80
80
  end
81
81
 
82
- def tail
82
+ def space2
83
83
  elements[2]
84
84
  end
85
+
86
+ def tail
87
+ elements[3]
88
+ end
85
89
  end
86
90
 
87
91
  module Logical2
@@ -110,78 +114,82 @@ module Equation
110
114
  end
111
115
 
112
116
  i0, s0 = index, []
113
- i1 = index
114
- r2 = _nt_boolean_and
115
- if r2
116
- r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
117
- r1 = r2
118
- else
119
- r3 = _nt_additive
117
+ r1 = _nt_space
118
+ s0 << r1
119
+ if r1
120
+ i2 = index
121
+ r3 = _nt_boolean_and
120
122
  if r3
121
123
  r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
122
- r1 = r3
124
+ r2 = r3
123
125
  else
124
- @index = i1
125
- r1 = nil
126
+ r4 = _nt_additive
127
+ if r4
128
+ r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
129
+ r2 = r4
130
+ else
131
+ @index = i2
132
+ r2 = nil
133
+ end
126
134
  end
127
- end
128
- s0 << r1
129
- if r1
130
- r4 = _nt_space
131
- s0 << r4
132
- if r4
133
- s5, i5 = [], index
134
- loop do
135
- i6, s6 = index, []
136
- if (match_len = has_terminal?('||', false, index))
137
- r7 = instantiate_node(SyntaxNode,input, index...(index + match_len))
138
- @index += match_len
139
- else
140
- terminal_parse_failure('\'||\'')
141
- r7 = nil
142
- end
143
- s6 << r7
144
- if r7
145
- r8 = _nt_space
146
- s6 << r8
135
+ s0 << r2
136
+ if r2
137
+ r5 = _nt_space
138
+ s0 << r5
139
+ if r5
140
+ s6, i6 = [], index
141
+ loop do
142
+ i7, s7 = index, []
143
+ if (match_len = has_terminal?('||', false, index))
144
+ r8 = instantiate_node(SyntaxNode,input, index...(index + match_len))
145
+ @index += match_len
146
+ else
147
+ terminal_parse_failure('\'||\'')
148
+ r8 = nil
149
+ end
150
+ s7 << r8
147
151
  if r8
148
- i9 = index
149
- r10 = _nt_boolean_and
150
- if r10
151
- r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
152
- r9 = r10
153
- else
154
- r11 = _nt_additive
152
+ r9 = _nt_space
153
+ s7 << r9
154
+ if r9
155
+ i10 = index
156
+ r11 = _nt_boolean_and
155
157
  if r11
156
158
  r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
157
- r9 = r11
159
+ r10 = r11
158
160
  else
159
- @index = i9
160
- r9 = nil
161
+ r12 = _nt_additive
162
+ if r12
163
+ r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
164
+ r10 = r12
165
+ else
166
+ @index = i10
167
+ r10 = nil
168
+ end
169
+ end
170
+ s7 << r10
171
+ if r10
172
+ r13 = _nt_space
173
+ s7 << r13
161
174
  end
162
- end
163
- s6 << r9
164
- if r9
165
- r12 = _nt_space
166
- s6 << r12
167
175
  end
168
176
  end
177
+ if s7.last
178
+ r7 = instantiate_node(SyntaxNode,input, i7...index, s7)
179
+ r7.extend(Logical0)
180
+ else
181
+ @index = i7
182
+ r7 = nil
183
+ end
184
+ if r7
185
+ s6 << r7
186
+ else
187
+ break
188
+ end
169
189
  end
170
- if s6.last
171
- r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
172
- r6.extend(Logical0)
173
- else
174
- @index = i6
175
- r6 = nil
176
- end
177
- if r6
178
- s5 << r6
179
- else
180
- break
181
- end
190
+ r6 = instantiate_node(SyntaxNode,input, i6...index, s6)
191
+ s0 << r6
182
192
  end
183
- r5 = instantiate_node(SyntaxNode,input, i5...index, s5)
184
- s0 << r5
185
193
  end
186
194
  end
187
195
  if s0.last
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: equation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OMAR