Sha256: e8d19b1fad120067f72485e83f88331024c85d1b28219a6c1ffb12ee899be373

Contents?: true

Size: 829 Bytes

Versions: 38

Compression:

Stored size: 829 Bytes

Contents

# frozen_string_literal: true

class Code
  class Parser
    class LeftOperation < 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(:first) << (
            whitespace? << operator.aka(:operator) << whitespace? <<
              right_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

38 entries across 38 versions & 1 rubygems

Version Path
code-ruby-1.2.5 lib/code/parser/left_operation.rb
code-ruby-1.2.4 lib/code/parser/left_operation.rb
code-ruby-1.2.3 lib/code/parser/left_operation.rb
code-ruby-1.2.2 lib/code/parser/left_operation.rb
code-ruby-1.2.1 lib/code/parser/left_operation.rb
code-ruby-1.1.3 lib/code/parser/left_operation.rb
code-ruby-1.1.1 lib/code/parser/left_operation.rb
code-ruby-1.1.0 lib/code/parser/left_operation.rb
code-ruby-1.0.0 lib/code/parser/left_operation.rb
code-ruby-0.15.16 lib/code/parser/left_operation.rb
code-ruby-0.15.15 lib/code/parser/left_operation.rb
code-ruby-0.15.14 lib/code/parser/left_operation.rb
code-ruby-0.15.13 lib/code/parser/left_operation.rb
code-ruby-0.15.12 lib/code/parser/left_operation.rb
code-ruby-0.15.11 lib/code/parser/left_operation.rb
code-ruby-0.15.10 lib/code/parser/left_operation.rb
code-ruby-0.15.9 lib/code/parser/left_operation.rb
code-ruby-0.15.8 lib/code/parser/left_operation.rb
code-ruby-0.15.7 lib/code/parser/left_operation.rb
code-ruby-0.15.6 lib/code/parser/left_operation.rb