Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| BacktrackState | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | |
| 4 | namespace Wikimedia\LangConv; |
| 5 | |
| 6 | /** |
| 7 | * A simple tuple type for the FST backtracking state. |
| 8 | */ |
| 9 | class BacktrackState { |
| 10 | /** |
| 11 | * State at which to resume execution if current execution fails. |
| 12 | * @var int |
| 13 | */ |
| 14 | public $epsState; |
| 15 | /** |
| 16 | * Number of previous epsilon edges to skip upon resume. |
| 17 | * @var int |
| 18 | */ |
| 19 | public $epsSkip; |
| 20 | /** |
| 21 | * Position in the output string. |
| 22 | * @var int |
| 23 | */ |
| 24 | public $outpos; |
| 25 | /** |
| 26 | * Speculative result string. |
| 27 | * @var string |
| 28 | */ |
| 29 | public $partialResult = ''; |
| 30 | /** |
| 31 | * Speculative bracket list. |
| 32 | * @var int[] |
| 33 | */ |
| 34 | public $partialBrackets = []; |
| 35 | /** |
| 36 | * Position in the input string. |
| 37 | * @var int |
| 38 | */ |
| 39 | public $idx; |
| 40 | |
| 41 | /** |
| 42 | * Create a new BacktrackState. |
| 43 | * @param int $epsState |
| 44 | * @param int $epsSkip |
| 45 | * @param int $outpos |
| 46 | * @param int $idx |
| 47 | */ |
| 48 | public function __construct( int $epsState, int $epsSkip, int $outpos, int $idx ) { |
| 49 | $this->epsState = $epsState; |
| 50 | $this->epsSkip = $epsSkip; |
| 51 | $this->outpos = $outpos; |
| 52 | $this->idx = $idx; |
| 53 | } |
| 54 | } |