League\CommonMark\Cursor::saveState PHP Method

saveState() public method

public saveState ( ) : CursorState
return CursorState
    public function saveState()
    {
        return new CursorState($this->line, $this->length, $this->currentPosition, $this->previousPosition, $this->firstNonSpaceCache, $this->indent, $this->column, $this->partiallyConsumedTab);
    }

Usage Example

Beispiel #1
0
 /**
  * @param  \League\CommonMark\ContextInterface $context
  * @param  \League\CommonMark\InlineParserContext $inlineContext
  * @return bool
  */
 public function parse(ContextInterface $context, InlineParserContext $inlineContext)
 {
     $this->context = $context;
     $this->inlineContext = $inlineContext;
     $this->cursor = $inlineContext->getCursor();
     $this->originalState = $this->cursor->saveState();
     $this->cursor->advance();
     return $this->parseMediaType();
 }
All Usage Examples Of League\CommonMark\Cursor::saveState