Sha256: 0cd6a03f641f024db996c5649d02cd3f0487e17d880bfd1a04e46478baf3a6fc
Contents?: true
Size: 458 Bytes
Versions: 16
Compression:
Stored size: 458 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[..-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
16 entries across 16 versions & 1 rubygems