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