71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
# File 'lib/hemingway/block/verbatim/verbatim.rb', line 71
def _nt_verbatim_text
start_index = index
if node_cache[:verbatim_text].has_key?(index)
cached = node_cache[:verbatim_text][index]
if cached
cached = SyntaxNode.new(input, index...(index + 1)) if cached == true
@index = cached.interval.end
end
return cached
end
s0, i0 = [], index
loop do
i1, s1 = index, []
i2 = index
i3, s3 = index, []
r4 = _nt_block_end
s3 << r4
if r4
r5 = _nt_verbatim_type
s3 << r5
if r5
if has_terminal?("}", false, index)
r6 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("}")
r6 = nil
end
s3 << r6
end
end
if s3.last
r3 = instantiate_node(SyntaxNode,input, i3...index, s3)
r3.extend(VerbatimText0)
else
@index = i3
r3 = nil
end
if r3
r2 = nil
else
@index = i2
r2 = instantiate_node(SyntaxNode,input, index...index)
end
s1 << r2
if r2
if index < input_length
r7 = instantiate_node(SyntaxNode,input, index...(index + 1))
@index += 1
else
terminal_parse_failure("any character")
r7 = nil
end
s1 << r7
end
if s1.last
r1 = instantiate_node(SyntaxNode,input, i1...index, s1)
r1.extend(VerbatimText1)
else
@index = i1
r1 = nil
end
if r1
s0 << r1
else
break
end
end
if s0.empty?
@index = i0
r0 = nil
else
r0 = instantiate_node(TextNode,input, i0...index, s0)
end
node_cache[:verbatim_text][start_index] = r0
r0
end
|