Пример #1
0
 /**
  * exp = e [ minus / plus ] 1*DIGIT
  * 
  * @param Context $context
  */
 private function handleExponentPart(Context $context)
 {
     // e = %x65 / %x45
     $current = $context->current();
     if ($current !== "e" && $current !== "E") {
         return;
     }
     $this->result .= "e";
     $this->isFloat = true;
     $next = $context->next();
     // [ minus / plus ]
     if ($next === "+" || $next === "-") {
         $this->result .= $next;
         $context->next();
     }
     // 1*DIGIT
     $this->handleFirstDigit($context);
     $this->handleDigitSequence($context);
 }
Пример #2
0
 /**
  * @covers Peach\DF\JsonCodec\Context::skip
  */
 public function testSkip()
 {
     $context = new Context("This is a pen.", new ArrayMap());
     // read "This "
     $context->skip(5);
     $this->assertSame("i", $context->current());
 }