Sha256: 4338b18d34f18d7b8cc9af9f550a63d7e3da3e3e9b9115455971d01521a8b210

Contents?: true

Size: 636 Bytes

Versions: 21

Compression:

Stored size: 636 Bytes

Contents

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

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

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

      def while_keyword
        str("while")
      end

      def until_keyword
        str("until")
      end

      def end_keyword
        str("end")
      end

      def root
        (
          (while_keyword | until_keyword).aka(:operator) << whitespace <<
            statement.aka(:statement) << code.aka(:body) << end_keyword.maybe
        ).aka(:while) | 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/while.rb
language-ruby-0.5.6 lib/code/parser/while.rb
code-ruby-0.5.6 lib/code/parser/while.rb
template-ruby-0.5.5 lib/code/parser/while.rb
language-ruby-0.5.5 lib/code/parser/while.rb
code-ruby-0.5.5 lib/code/parser/while.rb
template-ruby-0.5.4 lib/code/parser/while.rb
language-ruby-0.5.4 lib/code/parser/while.rb
code-ruby-0.5.4 lib/code/parser/while.rb
template-ruby-0.5.3 lib/code/parser/while.rb
language-ruby-0.5.3 lib/code/parser/while.rb
code-ruby-0.5.3 lib/code/parser/while.rb
template-ruby-0.5.2 lib/code/parser/while.rb
language-ruby-0.5.2 lib/code/parser/while.rb
code-ruby-0.5.2 lib/code/parser/while.rb
language-ruby-0.5.1 lib/code/parser/while.rb
template-ruby-0.5.1 lib/code/parser/while.rb
code-ruby-0.5.1 lib/code/parser/while.rb
template-ruby-0.5.0 lib/code/parser/while.rb
language-ruby-0.5.0 lib/code/parser/while.rb