Sha256: 484503969456d484ba895bd180546666f3194999722f3121bdefaac173924293
Contents?: true
Size: 459 Bytes
Versions: 9
Compression:
Stored size: 459 Bytes
Contents
# frozen_string_literal: true module ThemeCheck module ParsingHelpers # Yield each chunk outside of "...", '...' def outside_of_strings(markup) scanner = StringScanner.new(markup) while scanner.scan(/.*?("|')/) yield scanner.matched[0..-2] # Skip to the end of the string scanner.skip_until(scanner.matched[-1] == "'" ? /[^\\]'/ : /[^\\]"/) end yield scanner.rest if scanner.rest? end end end
Version data entries
9 entries across 9 versions & 1 rubygems