Sha256: 74aaaedd0fcd29ffcd66d1ccad5aa4ede88ccab183e9d17291c7bedcfa285aa1

Contents?: true

Size: 1.17 KB

Versions: 6

Compression:

Stored size: 1.17 KB

Contents

module WebIDL
  module ParseTree

    class ExtendedAttributeList < Treetop::Runtime::SyntaxNode
      def build(parent)
        list = [attribute.build(parent)]
        list += attributes.build(parent) unless attributes.empty?

        list
      end
    end

    class ExtendedAttributeArgList < Treetop::Runtime::SyntaxNode
      def build(parent)
        unless args.empty?
          arguments = args.build(parent)
        end
        Ast::ExtendedAttribute.new(name.text_value, arguments)
      end
    end

    class ExtendedAttributeIdent < Treetop::Runtime::SyntaxNode
      def build(parent)
        [key, value].map { |e| e.text_value }
      end
    end

    class ExtendedAttributeNamedArgList < Treetop::Runtime::SyntaxNode
      def build(parent)
        [key.text_value, value.build(parent)]
      end
    end

    class ExtendedAttributeScopedName < Treetop::Runtime::SyntaxNode
      def build(parent)
        [key.text_value, scoped_name.build(parent)]
      end
    end

    class ExtendedAttributeIdentList < Treetop::Runtime::SyntaxNode
      def build(parent)
        [key.text_value, list.text_value.split(",").map(&:strip)]
      end
    end

  end # ParseTree
end # WebIDL

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
webidl-0.2.2 lib/webidl/parse_tree/extended_attributes.rb
webidl-0.2.1 lib/webidl/parse_tree/extended_attributes.rb
webidl-0.1.10 lib/webidl/parse_tree/extended_attributes.rb
webidl-0.2.0 lib/webidl/parse_tree/extended_attributes.rb
webidl-0.1.9 lib/webidl/parse_tree/extended_attributes.rb
webidl-0.1.8 lib/webidl/parse_tree/extended_attributes.rb