We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9bfbbef commit b147c90Copy full SHA for b147c90
1 file changed
src/Expression/Children.php
@@ -1,6 +1,7 @@
1
<?php
2
namespace PackageFactory\Afx\Expression;
3
4
+use PackageFactory\Afx\Exception;
5
use PackageFactory\Afx\Lexer;
6
7
class Children
@@ -9,7 +10,11 @@ public static function parse(Lexer $lexer)
9
10
{
11
$contents = [];
12
$currentText = '';
- while (!$lexer->isEnd()) {
13
+ while (true) {
14
+ if ($lexer->isEnd()) {
15
+ throw new Exception('Unfinished child-list');
16
+ }
17
+
18
if ($lexer->isOpeningBracket()) {
19
$lexer->consume();
20
@@ -56,6 +61,8 @@ public static function parse(Lexer $lexer)
56
61
continue;
57
62
}
58
63
64
65
59
66
$currentText .= $lexer->consume();
60
67
68
0 commit comments