236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
|
# File 'lib/interscript/utils/regexp_converter.rb', line 236
def stringify_root(root, indent: 0)
warning = ''
root[:from] = [""] if root[:from] == []
str = " "*indent+"sub #{stringify(root[:from])}, #{root[:to]}"
[:before, :not_before, :after, :not_after].each do |look|
next unless root[look]
str_look = stringify(root[look])
str_look = "\"\"" if root[look] == [] || root[look] == nil
str << ", #{look}: #{str_look}"
end
str = " "*indent+"# #{str} # warning: :" if str =~ /[^\[]:[^ \]]/
str = " "*indent+"# #{str} # #{warning}" if !warning.empty?
str = " "*indent+"# #{str} # warning: :missing unimplemented" if str.include?(':missing')
str = " "*indent+"# #{str} # warning: :interval unimplemented" if str.include?(':interval')
str = " "*indent+"# #{str} # warning: :adding_ranges unimplemented" if str.include?(':adding_ranges')
if str.include?('zero_or_one')
str = " "*indent+"# #{str} # warning: zero_or_one"
puts "str.includes 'zero_or_one'"
pp root
end
str = " "*indent+"# #{str} # warning: :lookahead_start" if str.include?(':lookahead_start')
str
end
|