Sha256: 49e6fb715ce061ec9350628a234ae85ea261d2c013ab2be322dc8a54cf3e616f

Contents?: true

Size: 802 Bytes

Versions: 27

Compression:

Stored size: 802 Bytes

Contents

# frozen_string_literal: true

class Code
  class Parser
    class LeftOperation < Language
      def statement
        raise NotImplementedError
      end

      def whitespace
        Whitespace
      end

      def whitespace?
        whitespace.maybe
      end

      def operator
        raise NotImplementedError
      end

      def root
        (
          statement.aka(:first) << (
            whitespace? << operator.aka(:operator) << whitespace? <<
              statement.aka(:statement)
          ).repeat(1).aka(:others).maybe
        )
          .aka(:left_operation)
          .then do |output|
            if output[:left_operation][:others]
              output
            else
              output[:left_operation][:first]
            end
          end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
code-ruby-0.9.3 lib/code/parser/left_operation.rb
code-ruby-0.9.2 lib/code/parser/left_operation.rb
code-ruby-0.9.1 lib/code/parser/left_operation.rb
code-ruby-0.9.0 lib/code/parser/left_operation.rb
code-ruby-0.8.5 lib/code/parser/left_operation.rb
code-ruby-0.8.4 lib/code/parser/left_operation.rb
code-ruby-0.8.3 lib/code/parser/left_operation.rb
code-ruby-0.8.2 lib/code/parser/left_operation.rb
code-ruby-0.8.1 lib/code/parser/left_operation.rb
code-ruby-0.8.0 lib/code/parser/left_operation.rb
code-ruby-0.7.8 lib/code/parser/left_operation.rb
code-ruby-0.7.7 lib/code/parser/left_operation.rb
code-ruby-0.7.6 lib/code/parser/left_operation.rb
code-ruby-0.7.5 lib/code/parser/left_operation.rb
code-ruby-0.7.4 lib/code/parser/left_operation.rb
code-ruby-0.7.3 lib/code/parser/left_operation.rb
code-ruby-0.7.2 lib/code/parser/left_operation.rb
code-ruby-0.7.1 lib/code/parser/left_operation.rb
code-ruby-0.7.0 lib/code/parser/left_operation.rb
code-ruby-0.6.7 lib/code/parser/left_operation.rb