Sha256: 5165a1c6d49708a8881c6df3532ac6e337a6fa1aea25212093cff5b2d3e71869

Contents?: true

Size: 627 Bytes

Versions: 10

Compression:

Stored size: 627 Bytes

Contents

module WebIDL
  module ParseTree
    class Argument < Treetop::Runtime::SyntaxNode

      def build(parent)
        xattrs = eal.build(parent) unless eal.empty?

        options = {:extended_attributes => xattrs}

        if arg.respond_to?(:optional) && arg.optional.any?
          options[:optional] = true
          options[:default] = arg.default.build if arg.default.any?
        else
          options[:variadic] = arg.variadic.any?
        end

        Ast::Argument.new(
          arg.name.build,
          arg.type.build(parent),
          options
        )
      end

    end # Argument
  end # ParseTree
end # WebIDL

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
webidl-0.2.2 lib/webidl/parse_tree/argument.rb
webidl-0.2.1 lib/webidl/parse_tree/argument.rb
webidl-0.1.10 lib/webidl/parse_tree/argument.rb
webidl-0.2.0 lib/webidl/parse_tree/argument.rb
webidl-0.1.9 lib/webidl/parse_tree/argument.rb
webidl-0.1.8 lib/webidl/parse_tree/argument.rb
webidl-0.1.7 lib/webidl/parse_tree/argument.rb
webidl-0.1.6 lib/webidl/parse_tree/argument.rb
webidl-0.1.5 lib/webidl/parse_tree/argument.rb
webidl-0.1.4 lib/webidl/parse_tree/argument.rb