@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | public function handle(Parser $parser, Assembler $asm, Token $token): void |
| 25 | 25 | { |
| 26 | - switch ($token->type) { |
|
| 26 | + switch ($token->type){ |
|
| 27 | 27 | case DynamicGrammar::TYPE_DIRECTIVE: |
| 28 | 28 | $this->directive = new Directive(new Parser\Context($token, $parser->getPath())); |
| 29 | 29 | $asm->push($this->directive); |
@@ -48,20 +48,20 @@ discard block |
||
| 48 | 48 | break; |
| 49 | 49 | |
| 50 | 50 | case DynamicGrammar::TYPE_KEYWORD: |
| 51 | - if ($this->directive !== null) { |
|
| 51 | + if ($this->directive !== null){ |
|
| 52 | 52 | $this->directive->name = $token->content; |
| 53 | 53 | } |
| 54 | 54 | break; |
| 55 | 55 | |
| 56 | 56 | case DynamicGrammar::TYPE_BODY: |
| 57 | - if ($this->directive !== null) { |
|
| 57 | + if ($this->directive !== null){ |
|
| 58 | 58 | $this->directive->body = $token->content; |
| 59 | 59 | $this->directive->values = $this->fetchValues($this->directive->body); |
| 60 | 60 | |
| 61 | 61 | $this->directive = null; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | - if ($this->output !== null) { |
|
| 64 | + if ($this->output !== null){ |
|
| 65 | 65 | $this->output->body = $token->content; |
| 66 | 66 | } |
| 67 | 67 | |
@@ -79,31 +79,31 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | $src = new StringStream($body); |
| 81 | 81 | |
| 82 | - while ($n = $src->peak()) { |
|
| 83 | - if (\in_array($n, ['"', "'"], true)) { |
|
| 82 | + while ($n = $src->peak()){ |
|
| 83 | + if (\in_array($n, ['"', "'"], true)){ |
|
| 84 | 84 | $values[\count($values) - 1] .= $n; |
| 85 | - while (($nn = $src->peak()) !== null) { |
|
| 85 | + while (($nn = $src->peak()) !== null){ |
|
| 86 | 86 | $values[\count($values) - 1] .= $nn; |
| 87 | - if ($nn === $n) { |
|
| 87 | + if ($nn === $n){ |
|
| 88 | 88 | break; |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | continue; |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | - if ($n === ',' && $level === 0) { |
|
| 94 | + if ($n === ',' && $level === 0){ |
|
| 95 | 95 | $values[] = ''; |
| 96 | 96 | continue; |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $values[\count($values) - 1] .= $n; |
| 100 | 100 | |
| 101 | - if ($n === '(' || $n === '[' || $n === '{') { |
|
| 101 | + if ($n === '(' || $n === '[' || $n === '{'){ |
|
| 102 | 102 | $level++; |
| 103 | 103 | continue; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | - if ($n === ')' || $n === ']' || $n === '}') { |
|
| 106 | + if ($n === ')' || $n === ']' || $n === '}'){ |
|
| 107 | 107 | $level--; |
| 108 | 108 | } |
| 109 | 109 | } |