Method: CBOR_DIAG#_nt_value

Defined in:
lib/cbor-diag-parser.rb

#_nt_valueObject



144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/cbor-diag-parser.rb', line 144

def _nt_value
  start_index = index
  if node_cache[:value].has_key?(index)
    cached = node_cache[:value][index]
    if cached
      node_cache[:value][index] = cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
      @index = cached.interval.end
    end
    return cached
  end

  i0 = index
  r1 = _nt_string
  if r1
    r1 = SyntaxNode.new(input, (index-1)...index) if r1 == true
    r0 = r1
  else
    r2 = _nt_map
    if r2
      r2 = SyntaxNode.new(input, (index-1)...index) if r2 == true
      r0 = r2
    else
      r3 = _nt_array
      if r3
        r3 = SyntaxNode.new(input, (index-1)...index) if r3 == true
        r0 = r3
      else
        r4 = _nt_tagged
        if r4
          r4 = SyntaxNode.new(input, (index-1)...index) if r4 == true
          r0 = r4
        else
          r5 = _nt_hnumber
          if r5
            r5 = SyntaxNode.new(input, (index-1)...index) if r5 == true
            r0 = r5
          else
            r6 = _nt_fnumber
            if r6
              r6 = SyntaxNode.new(input, (index-1)...index) if r6 == true
              r0 = r6
            else
              r7 = _nt_infin
              if r7
                r7 = SyntaxNode.new(input, (index-1)...index) if r7 == true
                r0 = r7
              else
                r8 = _nt_simple
                if r8
                  r8 = SyntaxNode.new(input, (index-1)...index) if r8 == true
                  r0 = r8
                else
                  r9 = _nt_hstring
                  if r9
                    r9 = SyntaxNode.new(input, (index-1)...index) if r9 == true
                    r0 = r9
                  else
                    r10 = _nt_bstring
                    if r10
                      r10 = SyntaxNode.new(input, (index-1)...index) if r10 == true
                      r0 = r10
                    else
                      r11 = _nt_b64string
                      if r11
                        r11 = SyntaxNode.new(input, (index-1)...index) if r11 == true
                        r0 = r11
                      else
                        r12 = _nt_appstring
                        if r12
                          r12 = SyntaxNode.new(input, (index-1)...index) if r12 == true
                          r0 = r12
                        else
                          r13 = _nt_embedded
                          if r13
                            r13 = SyntaxNode.new(input, (index-1)...index) if r13 == true
                            r0 = r13
                          else
                            r14 = _nt_streamstring
                            if r14
                              r14 = SyntaxNode.new(input, (index-1)...index) if r14 == true
                              r0 = r14
                            else
                              @index = i0
                              r0 = nil
                            end
                          end
                        end
                      end
                    end
                  end
                end
              end
            end
          end
        end
      end
    end
  end

  node_cache[:value][start_index] = r0

  r0
end