Sha256: cd85d4371413b2025e2cd038dae6165c7b58a15c545d712f2139bbf88527c906
Contents?: true
Size: 364 Bytes
Versions: 11
Compression:
Stored size: 364 Bytes
Contents
module FastHaml module ParserUtils module_function def balance(scanner, start, finish, depth = 1) re = /(#{Regexp.escape(start)}|#{Regexp.escape(finish)})/ while depth > 0 && scanner.scan_until(re) if scanner.matched == start depth += 1 else depth -= 1 end end depth end end end
Version data entries
11 entries across 11 versions & 1 rubygems