| @@ 30-35 (lines=6) @@ | ||
| 27 | $name = null; |
|
| 28 | $parent = null; |
|
| 29 | if (!$stream->test(Twig_Token::BLOCK_END_TYPE)) { |
|
| 30 | if ($stream->test(Twig_Token::STRING_TYPE)) { |
|
| 31 | // {% feature "name" %} |
|
| 32 | $name = $stream->next()->getValue(); |
|
| 33 | } elseif (!$stream->test(Twig_Token::BLOCK_END_TYPE)) { |
|
| 34 | throw new Twig_Error_Syntax( |
|
| 35 | 'Unexpected token. Twig was looking for the "name" string.' |
|
| 36 | ); |
|
| 37 | } |
|
| 38 | if ($stream->test('from')) { |
|
| @@ 38-44 (lines=7) @@ | ||
| 35 | 'Unexpected token. Twig was looking for the "name" string.' |
|
| 36 | ); |
|
| 37 | } |
|
| 38 | if ($stream->test('from')) { |
|
| 39 | // {% feature "name" from "parent" %} |
|
| 40 | $stream->next(); |
|
| 41 | $parent = $stream->next()->getValue(); |
|
| 42 | } elseif (!$stream->test(Twig_Token::BLOCK_END_TYPE)) { |
|
| 43 | throw new Twig_Error_Syntax( |
|
| 44 | 'Unexpected token. Twig was looking for the "from" keyword.' |
|
| 45 | ); |
|
| 46 | } |
|
| 47 | } |
|