| @@ 139-153 (lines=15) @@ | ||
| 136 | * @throws \InvalidArgumentException |
|
| 137 | * @throws \LogicException |
|
| 138 | */ |
|
| 139 | private function extractSectionName() |
|
| 140 | { |
|
| 141 | start: |
|
| 142 | $char = $this->stream->currentAscii(); |
|
| 143 | ||
| 144 | if ($char->isLetter() || $char->isDigit() || $char->is(AsciiChar::UNDERSCORE)) { |
|
| 145 | $this->currentSection['name'] .= $this->stream->current(); |
|
| 146 | $this->stream->next(); |
|
| 147 | goto start; |
|
| 148 | } elseif ($char->isWhiteSpace() || $char->is(AsciiChar::COLON)) { |
|
| 149 | return; |
|
| 150 | } else { |
|
| 151 | throw new SyntaxErrorException($this->stream); |
|
| 152 | } |
|
| 153 | } |
|
| 154 | ||
| 155 | /** |
|
| 156 | * @internal |
|
| @@ 186-200 (lines=15) @@ | ||
| 183 | * @throws \InvalidArgumentException |
|
| 184 | * @throws \LogicException |
|
| 185 | */ |
|
| 186 | private function extractInheritanceName() |
|
| 187 | { |
|
| 188 | start: |
|
| 189 | $char = $this->stream->currentAscii(); |
|
| 190 | ||
| 191 | if ($char->isLetter() || $char->isDigit() || $char->is(AsciiChar::UNDERSCORE)) { |
|
| 192 | $this->currentSection['inheritance'] .= $this->stream->current(); |
|
| 193 | $this->stream->next(); |
|
| 194 | goto start; |
|
| 195 | } elseif ($char->isWhiteSpace()) { |
|
| 196 | return; |
|
| 197 | } else { |
|
| 198 | throw new SyntaxErrorException($this->stream); |
|
| 199 | } |
|
| 200 | } |
|
| 201 | ||
| 202 | /** |
|
| 203 | * @internal |
|
| @@ 260-274 (lines=15) @@ | ||
| 257 | * @throws \InvalidArgumentException |
|
| 258 | * @throws \LogicException |
|
| 259 | */ |
|
| 260 | private function extractOptionName() |
|
| 261 | { |
|
| 262 | start: |
|
| 263 | $char = $this->stream->currentAscii(); |
|
| 264 | ||
| 265 | if ($char->isLetter() || $char->isDigit() || $char->is(AsciiChar::UNDERSCORE)) { |
|
| 266 | $this->currentOption['name'] .= $this->stream->current(); |
|
| 267 | $this->stream->next(); |
|
| 268 | goto start; |
|
| 269 | } elseif ($char->isHorizontalSpace()) { |
|
| 270 | return; |
|
| 271 | } else { |
|
| 272 | throw new SyntaxErrorException($this->stream); |
|
| 273 | } |
|
| 274 | } |
|
| 275 | ||
| 276 | /** |
|
| 277 | * @internal |
|