rbs
rbs copied to clipboard
Implement context validation on parse
Contextual limitations are now performed at parse time.
This change was originally planned for version 3.4 but remained unaddressed.
We plan to change the parser to reject those types if it breaks the contextual limitations in next release --
3.4.
I propose introducing it with the release of version 4.0.
Changes
- The check will only be performed in
Parser.parse_signature. RBS::UnitTest, they have not been removed in this PR.- Deprecate
--[no-]exit-error-on-syntax-erroroption. - Raise
RBS::ParsingErrorinstead ofRBS::WillSyntaxError. - Remove
RBS::WillSyntaxError. - Contextual limitations checks in the
rbs validatecommand have been stopped. - Gave up analyzing
CONST: selfin therbs prototype rb.
Not changes
- I have not changed that
RBS::ParsingErroris raised for compatibility with Steep. It may be possible to use a different error name. Parser.parse_typeandParser.parse_method_typedo not currently perform checks. It might be worth adding them.- Since
has_self_type?,has_classish_type?, andwith_nonreturn_void?are used inRBS::UnitTest, they have not been removed in this PR.
Rebased on master.
Thank you for reviewing. I'll fix soon.
I only renamed rbs_type_validation_t to rbs_type_parsing_option_t.