error and the module nesting context is lost → Absolute type name is inserted 🤷 module Parseg module ParsingSession def intersect?: (Parseg::TokenFactory::change) end end module Parseg module ParsingSession def intersect?: (c) end end
→ Relative type name is inserted 🙆 module Parseg module ParsingSession def intersect?: ... -> TokenFactory::change end end module Parseg module ParsingSession def intersect?: ... -> c end end
are: • Possible fi rst tokens of type (UIDENT, void, untyped, ...) • class, attr_reader, and def for next class_member • end for closing the class declaration • class for next class declaration attr_reader ::= attr_reader attribute_name : type
errors • Skip tokens that cannot be consumed with other possible rules 😃 This is well-known error recovery strategy for top-down parsers. (https://github.com/microsoft/tolerant-php-parser)
de fi nition • Conference#initialize disappears and unexpected type error will be detected • Better error recovery is to close the Talk de fi nition immediately
void end class Conference class Talk def initialize: (String, Integer) -> void end class Conference class Talk end def initialize: (String, Integer) -> void end
void end class Conference class Talk def initialize: (String, Integer) -> void end class Conference class Talk end def initialize: (String, Integer) -> void end class Conference
cation • 👍 Token based change detection • No tree di ff calculation required • Changed tokens are easily detected by LSP edit noti fi cations • 😵 Unsupported text editing patterns may result in confusing errors
Trial 2: Based on control fl ow analysis (2009) • (Break until Oedo RubyKaigi 2017) • Trial 3: Steep -- introducing type declarations My 15 years for type checking Ruby programs
Trial 2: Based on control fl ow analysis (2009) • (Break until Oedo RubyKaigi 2017) • Trial 3: Steep -- introducing type declarations My 15 years for type checking Ruby programs
Trial 2: Based on control fl ow analysis (2009) • (Break until Oedo RubyKaigi 2017) • Trial 3: Steep -- introducing type declarations My 15 years for type checking Ruby programs