Sha256: 9bbf3ca6f63bda5bf3f3bab8b8a355492dd3afa4774f3746d3bf62e9c437fc65

Contents?: true

Size: 803 Bytes

Versions: 33

Compression:

Stored size: 803 Bytes

Contents

# frozen_string_literal: true

class Code
  class Parser
    class RightOperation < Language
      def statement
        Statement
      end

      def whitespace
        Whitespace
      end

      def whitespace?
        whitespace.maybe
      end

      def operator
        str("")
      end

      def right_statement
        Statement
      end

      def root
        (
          statement.aka(:left) << (
            whitespace? << operator.aka(:operator) << whitespace? <<
              right_statement.aka(:right)
          ).maybe
        )
          .aka(:right_operation)
          .then do |output|
            if output[:right_operation][:right]
              output
            else
              output[:right_operation][:left]
            end
          end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
code-ruby-1.1.3 lib/code/parser/right_operation.rb
code-ruby-1.1.1 lib/code/parser/right_operation.rb
code-ruby-1.1.0 lib/code/parser/right_operation.rb
code-ruby-1.0.0 lib/code/parser/right_operation.rb
code-ruby-0.15.16 lib/code/parser/right_operation.rb
code-ruby-0.15.15 lib/code/parser/right_operation.rb
code-ruby-0.15.14 lib/code/parser/right_operation.rb
code-ruby-0.15.13 lib/code/parser/right_operation.rb
code-ruby-0.15.12 lib/code/parser/right_operation.rb
code-ruby-0.15.11 lib/code/parser/right_operation.rb
code-ruby-0.15.10 lib/code/parser/right_operation.rb
code-ruby-0.15.9 lib/code/parser/right_operation.rb
code-ruby-0.15.8 lib/code/parser/right_operation.rb
code-ruby-0.15.7 lib/code/parser/right_operation.rb
code-ruby-0.15.6 lib/code/parser/right_operation.rb
code-ruby-0.15.5 lib/code/parser/right_operation.rb
code-ruby-0.15.4 lib/code/parser/right_operation.rb
code-ruby-0.15.3 lib/code/parser/right_operation.rb
code-ruby-0.15.2 lib/code/parser/right_operation.rb
code-ruby-0.15.0 lib/code/parser/right_operation.rb