Exception: MCPClient::SchemaValidator::EcmaPatterns::Untranslatable
- Inherits:
-
RegexpError
- Object
- RegexpError
- MCPClient::SchemaValidator::EcmaPatterns::Untranslatable
- Defined in:
- lib/mcp_client/schema_validator/ecma_patterns.rb
Overview
A pattern that IS an ECMA-262 expression but whose meaning Ruby's engine cannot be made to reproduce, so translating it would answer some instances wrongly. The two engines differ in two ways no rewriting bridges:
- ECMA-262 clears the captures inside a quantified group at the start
of every iteration (a back-reference to a group the last iteration
did not enter matches the empty string); Ruby keeps whatever the
last iteration that entered it captured.
^(a|(b))*\2$accepts "aba" and refuses "abab" there, and exactly the opposite here. - ECMA-262 lookbehind is variable-length (ES2018); Ruby's is not.
Refusing the schema is the only honest answer left: a verdict from the other engine's rules would accept structured content the schema forbids as readily as it would refuse conforming content.