Module: SimpleCov::Formatter::AIFormatter::ASTResolver::LenientLiterals

Extended by:
T::Sig
Defined in:
lib/simplecov-ai/ast_resolver/lenient_literals.rb

Overview

Extended onto a parser builder so it accepts string literals whose escape sequences produce bytes that are invalid in the source encoding (e.g. "\xf0-\xff"). MRI and Prism accept such literals, but the parser builder rejects them with "literal contains escape sequences incompatible with UTF-8", which would discard the structure of an otherwise valid file.

Instance Method Summary collapse

Instance Method Details

#string_value(token) ⇒ Object



19
20
21
# File 'lib/simplecov-ai/ast_resolver/lenient_literals.rb', line 19

def string_value(token)
  token.fetch(0)
end