Commits

Kaspar Schiess committed 8458205

Top operations

  • Participants
  • Parent commits 07cbd37

Comments (0)

Files changed (2)

       def >> other
         self
       end
-
       def | other
         other
       end
-
       def maybe
         Par.top
       end
       def >> other
         other
       end
+      def | other
+        self
+      end
     end
   end
   class Source

spec/lib/par/result_spec.rb

     it 'allows concatenation right' do
       (any >> top).should == any
     end
+    it 'allows alternation' do
+      (any | top).should == any
+      (top | any).should == top
+    end
+    it 'can be maybeed' do
+      top.maybe.should == top
+    end
   end
 end