class Crass::Tokenizer
def consume_escaped
or EOF.
next character in the input has already been verified not to be a newline
This method assumes that the `\` has already been consumed, and that the
Consumes an escaped code point and returns its unescaped value.
def consume_escaped return "\ufffd" if @s.eos? if hex_str = @s.scan(RE_HEX) @s.consume if @s.peek =~ RE_WHITESPACE codepoint = hex_str.hex if codepoint == 0 || codepoint.between?(0xD800, 0xDFFF) || codepoint > 0x10FFFF return "\ufffd" else return codepoint.chr(Encoding::UTF_8) end end @s.consume end