Sha256: 5303c005409b66afe76d2e9fb18dc61b212a2c9532a13db979c76114a67fdf89
Contents?: true
Size: 360 Bytes
Versions: 17
Compression:
Stored size: 360 Bytes
Contents
module Faml 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
17 entries across 17 versions & 1 rubygems