64 $this->parts = [
new $class ];
66 foreach ( $data as $name => $value ) {
67 $this->$name = $value;
72 return $this->parts[count( $this->parts ) - 1]->out;
77 $this->parts[] =
new $class(
$s );
84 return $this->parts[count( $this->parts ) - 1];
91 $partCount = count( $this->parts );
92 $findPipe = $this->open !=
"\n" && $this->open !=
'[';
94 'findPipe' => $findPipe,
95 'findEquals' => $findPipe && $partCount > 1 && !isset( $this->parts[$partCount - 1]->eqpos ),
96 'inHeading' => $this->open ==
"\n",
107 if ( $this->open ==
"\n" ) {
108 $s = $this->savedPrefix . $this->parts[0]->out;
110 if ( $openingCount ===
false ) {
113 $s = substr( $this->open, 0, -1 );
115 substr( $this->open, -1 ),
116 $openingCount - strlen(
$s )
118 $s = $this->savedPrefix .
$s;
120 foreach ( $this->parts as $part ) {
string $open
Opening character (\n for heading)
bool $lineStart
True if the open char appeared at the start of the input line.
PPDPart[] $parts
Array of PPDPart objects describing pipe-separated parts.
string $savedPrefix
Saved prefix that may affect later processing, e.g.
string $close
Matching closing character.
breakSyntax( $openingCount=false)
Get the output string that would result if the close is not found.
int $count
Number of opening characters found (number of "=" for heading)