class Syntax::YAML

def scan_string( delim )

def scan_string( delim )
  regex = /(?=[#{delim=="'" ? "" : "\\\\"}#{delim}])/
  loop do
    text = scan_until( regex )
    if text.nil?
      start_group :string, scan_until( /\Z/ )
      break
    else
      start_group :string, text unless text.empty?
    end
    case peek(1)
      when "\\"
        start_group :expr, scan(/../)
      else
        start_group :punct, getch
        break
    end
  end
end