Sha256: 26a30fc9a2b5e68cb46a27f66734e57cc18383168b984724d14b22a074c2a555

Contents?: true

Size: 765 Bytes

Versions: 21

Compression:

Stored size: 765 Bytes

Contents

class Code
  class Parser
    class Class < Language
      def statement
        ::Code::Parser::While
      end

      def name
        ::Code::Parser::Name
      end

      def code
        ::Code::Parser::Code
      end

      def whitespace
        ::Code::Parser::Whitespace
      end

      def whitespace?
        whitespace.maybe
      end

      def class_keyword
        str("class")
      end

      def end_keyword
        str("end")
      end

      def lesser
        str("<")
      end

      def root
        (
          class_keyword << whitespace? << name.aka(:name) <<
          (whitespace? << lesser << name.aka(:superclass)).maybe <<
          code.aka(:body) << end_keyword.maybe
        ).aka(:class) | statement
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 3 rubygems

Version Path
template-ruby-0.5.6 lib/code/parser/class.rb
language-ruby-0.5.6 lib/code/parser/class.rb
code-ruby-0.5.6 lib/code/parser/class.rb
template-ruby-0.5.5 lib/code/parser/class.rb
language-ruby-0.5.5 lib/code/parser/class.rb
code-ruby-0.5.5 lib/code/parser/class.rb
template-ruby-0.5.4 lib/code/parser/class.rb
language-ruby-0.5.4 lib/code/parser/class.rb
code-ruby-0.5.4 lib/code/parser/class.rb
template-ruby-0.5.3 lib/code/parser/class.rb
language-ruby-0.5.3 lib/code/parser/class.rb
code-ruby-0.5.3 lib/code/parser/class.rb
template-ruby-0.5.2 lib/code/parser/class.rb
language-ruby-0.5.2 lib/code/parser/class.rb
code-ruby-0.5.2 lib/code/parser/class.rb
language-ruby-0.5.1 lib/code/parser/class.rb
template-ruby-0.5.1 lib/code/parser/class.rb
code-ruby-0.5.1 lib/code/parser/class.rb
template-ruby-0.5.0 lib/code/parser/class.rb
language-ruby-0.5.0 lib/code/parser/class.rb