BacktickParser
in package
implements
InlineParserInterface
FinalYes
Table of Contents
Interfaces
Constants
- MAX_BACKTICKS = 1000
- Max bound for backtick code span delimiters.
Properties
- $lastCursor : WeakReference<string|int, Cursor>|null
- $lastCursorScanned : bool
- $seenBackticks : array<int, int>
Methods
- getMatchDefinition() : InlineParserMatch
- parse() : bool
- findMatchingTicks() : bool
- Locates the matching closer for a backtick code span.
Constants
MAX_BACKTICKS
Max bound for backtick code span delimiters.
private
mixed
MAX_BACKTICKS
= 1000
Tags
Properties
$lastCursor
private
WeakReference<string|int, Cursor>|null
$lastCursor
= null
$lastCursorScanned
private
bool
$lastCursorScanned
= false
$seenBackticks
private
array<int, int>
$seenBackticks
= []
backtick count => position of known ender
Methods
getMatchDefinition()
public
getMatchDefinition() : InlineParserMatch
Return values
InlineParserMatchparse()
public
parse(InlineParserContext $inlineContext) : bool
Parameters
- $inlineContext : InlineParserContext
Return values
boolfindMatchingTicks()
Locates the matching closer for a backtick code span.
private
findMatchingTicks(int $openTickLength, Cursor $cursor) : bool
Leverages some caching to avoid traversing the same cursor multiple times when we've already seen all the potential backtick closers.
Parameters
- $openTickLength : int
-
Number of backticks in the opening sequence
- $cursor : Cursor
-
Cursor to scan
Tags
Return values
bool —True if a matching closer was found, false otherwise