Package org.ocpsoft.rewrite.util.ParseTools

Examples of org.ocpsoft.rewrite.util.ParseTools.CapturingGroup


   }

   @Test
   public void testBalancedCaptureNested2()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 4, 28,
               CaptureType.PAREN);
      Assert.assertEquals(8, group.getEnd());
      Assert.assertArrayEquals("two".toCharArray(), group.getCaptured());
   }
View Full Code Here


   }

   @Test
   public void testBalancedCaptureNested3()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 9, 28,
               CaptureType.PAREN);
      Assert.assertEquals(27, group.getEnd());
      Assert.assertArrayEquals("three(four(five))".toCharArray(), group.getCaptured());
   }
View Full Code Here

   }

   @Test
   public void testBalancedCaptureNested4()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 15, 28,
               CaptureType.PAREN);
      Assert.assertEquals(26, group.getEnd());
      Assert.assertArrayEquals("four(five)".toCharArray(), group.getCaptured());
   }
View Full Code Here

   }

   @Test
   public void testBalancedCaptureNested5()
   {
      CapturingGroup group = ParseTools.balancedCapture("(one(two)(three(four(five))))".toCharArray(), 20, 28,
               CaptureType.PAREN);
      Assert.assertEquals(25, group.getEnd());
      Assert.assertArrayEquals("five".toCharArray(), group.getCaptured());
   }
View Full Code Here

TOP

Related Classes of org.ocpsoft.rewrite.util.ParseTools.CapturingGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.