| @@ 145-159 (lines=15) @@ | ||
| 142 | * @throws \InvalidArgumentException |
|
| 143 | * @throws \LogicException |
|
| 144 | */ |
|
| 145 | private function extractSectionName() |
|
| 146 | { |
|
| 147 | start: |
|
| 148 | $char = $this->stream->currentAscii(); |
|
| 149 | ||
| 150 | if ($char->isLetter() || $char->isDigit() || $char->is(AsciiChar::UNDERSCORE)) { |
|
| 151 | $this->currentSection['name'] .= $this->stream->current(); |
|
| 152 | $this->stream->next(); |
|
| 153 | goto start; |
|
| 154 | } elseif ($char->isWhiteSpace() || $char->is(AsciiChar::COLON)) { |
|
| 155 | return; |
|
| 156 | } else { |
|
| 157 | throw new SyntaxErrorException($this->stream); |
|
| 158 | } |
|
| 159 | } |
|
| 160 | ||
| 161 | /** |
|
| 162 | * @internal |
|
| @@ 192-206 (lines=15) @@ | ||
| 189 | * @throws \InvalidArgumentException |
|
| 190 | * @throws \LogicException |
|
| 191 | */ |
|
| 192 | private function extractInheritanceName() |
|
| 193 | { |
|
| 194 | start: |
|
| 195 | $char = $this->stream->currentAscii(); |
|
| 196 | ||
| 197 | if ($char->isLetter() || $char->isDigit() || $char->is(AsciiChar::UNDERSCORE)) { |
|
| 198 | $this->currentSection['inheritance'] .= $this->stream->current(); |
|
| 199 | $this->stream->next(); |
|
| 200 | goto start; |
|
| 201 | } elseif ($char->isWhiteSpace()) { |
|
| 202 | return; |
|
| 203 | } else { |
|
| 204 | throw new SyntaxErrorException($this->stream); |
|
| 205 | } |
|
| 206 | } |
|
| 207 | ||
| 208 | /** |
|
| 209 | * @internal |
|
| @@ 266-280 (lines=15) @@ | ||
| 263 | * @throws \InvalidArgumentException |
|
| 264 | * @throws \LogicException |
|
| 265 | */ |
|
| 266 | private function extractOptionName() |
|
| 267 | { |
|
| 268 | start: |
|
| 269 | $char = $this->stream->currentAscii(); |
|
| 270 | ||
| 271 | if ($char->isLetter() || $char->isDigit() || $char->is(AsciiChar::UNDERSCORE)) { |
|
| 272 | $this->currentOption['name'] .= $this->stream->current(); |
|
| 273 | $this->stream->next(); |
|
| 274 | goto start; |
|
| 275 | } elseif ($char->isHorizontalSpace()) { |
|
| 276 | return; |
|
| 277 | } else { |
|
| 278 | throw new SyntaxErrorException($this->stream); |
|
| 279 | } |
|
| 280 | } |
|
| 281 | ||
| 282 | /** |
|
| 283 | * @internal |
|