Pristine upstream, unpacked from the official wordpress.org tarball. https://wordpress.org/wordpress-7.1.1.tar.gz sha1 2a9d68474e8703aa3a66f80427b325e0941b6a1e (published by wordpress.org) sha256 3996fee13448ef12e07e9f0c77db2f655ffa1b7cde71c80a4965d3bf1fb956b3 This branch carries nothing but upstream releases, one commit each, and is never edited. It is the other side of the git-subtree merge that brings security releases into SiriusPress/wordpress/ — see SiriusPress/docs/upstream-merges.md.
79 lines
1.9 KiB
PHP
79 lines
1.9 KiB
PHP
<?php
|
|
/**
|
|
* Block Serialization Parser
|
|
*
|
|
* @package WordPress
|
|
*/
|
|
|
|
/**
|
|
* Class WP_Block_Parser_Frame
|
|
*
|
|
* Holds partial blocks in memory while parsing
|
|
*
|
|
* @internal
|
|
* @since 5.0.0
|
|
*/
|
|
class WP_Block_Parser_Frame {
|
|
/**
|
|
* Full or partial block
|
|
*
|
|
* @since 5.0.0
|
|
* @var WP_Block_Parser_Block
|
|
*/
|
|
public $block;
|
|
|
|
/**
|
|
* Byte offset into document for start of parse token
|
|
*
|
|
* @since 5.0.0
|
|
* @var int
|
|
*/
|
|
public $token_start;
|
|
|
|
/**
|
|
* Byte length of entire parse token string
|
|
*
|
|
* @since 5.0.0
|
|
* @var int
|
|
*/
|
|
public $token_length;
|
|
|
|
/**
|
|
* Byte offset into document for after parse token ends
|
|
* (used during reconstruction of stack into parse production)
|
|
*
|
|
* @since 5.0.0
|
|
* @var int
|
|
*/
|
|
public $prev_offset;
|
|
|
|
/**
|
|
* Byte offset into document where leading HTML before token starts
|
|
*
|
|
* @since 5.0.0
|
|
* @var int
|
|
*/
|
|
public $leading_html_start;
|
|
|
|
/**
|
|
* Constructor
|
|
*
|
|
* Will populate object properties from the provided arguments.
|
|
*
|
|
* @since 5.0.0
|
|
*
|
|
* @param WP_Block_Parser_Block $block Full or partial block.
|
|
* @param int $token_start Byte offset into document for start of parse token.
|
|
* @param int $token_length Byte length of entire parse token string.
|
|
* @param int|null $prev_offset Optional. Byte offset into document for after parse token ends. Default null.
|
|
* @param int|null $leading_html_start Optional. Byte offset into document where leading HTML before token starts.
|
|
* Default null.
|
|
*/
|
|
public function __construct( $block, $token_start, $token_length, $prev_offset = null, $leading_html_start = null ) {
|
|
$this->block = $block;
|
|
$this->token_start = $token_start;
|
|
$this->token_length = $token_length;
|
|
$this->prev_offset = $prev_offset ?? $token_start + $token_length;
|
|
$this->leading_html_start = $leading_html_start;
|
|
}
|
|
}
|