vendor/github.com/hashicorp/hcl/v2/hclsyntax/unicode2ragel.rb
def utf8_ranges( range )
  ranges = []
  UTF8_BOUNDARIES.each do |max|
    if range.begin <= max
      if range.end <= max
        ranges << range
        return ranges
      end

      ranges << (range.begin .. max)
      range = (max + 1) .. range.end
    end
  end
  ranges
end
###
# Given a range, splits it up into ranges that can be continuously
# encoded into utf8.  Eg: 0x00 .. 0xff => [0x00..0x7f, 0x80..0xff]
# This is not strictly needed since the current [5.1] unicode standard
# doesn't have ranges that straddle utf8 boundaries.  This is included
# for completeness as there is no telling if that will ever change.
Given a range, splits it up into ranges that can be continuously
encoded into utf8.
Given a range splits it up into ranges that can be continuously encoded into utf8 .
def utf8_ranges( range )
  ranges = []
  UTF8_BOUNDARIES.each do |max|
    if range.begin <= max
      if range.end <= max
        ranges << range
        return ranges
      end
      ranges << (range.begin .. max)
      range = (max + 1) .. range.end
    end
  end
  ranges
end
def utf8_ranges ( range ) ranges = [ ] UTF8_BOUNDARIES . each do | max | if range . begin <= max if range . end <= max ranges << range return ranges end ranges << ( range . begin .. max ) range = ( max + 1 ) .. range . end end end ranges end
Given a range, splits it up into ranges that can be continuously
encoded into utf8.
Given a range splits it up into ranges that can be continuously encoded into utf8 .
range