class Vernacular::AST::Modifiers::TypedMethodReturns

Extends Ruby syntax to allow typed method return declarations, as in:

def my_method(argument_a, argument_b) = return_type; end

Private Class Methods

new() click to toggle source
Calls superclass method
# File lib/vernacular/ast/modifiers/typed_method_returns.rb, line 9
        def initialize
          super

          extend_parser(:f_arglist, 'f_arglist tEQL cpath', <<~PARSE)
            result = @builder.type_check_arglist(*val)
          PARSE

          extend_builder(:type_check_arglist) do |arglist, equal, cpath|
            arglist << n(:type_check_arglist, [equal, cpath], nil)
          end

          build_rewriter { include TypedMethodReturnsRewriter }
        end