Changeset View
Changeset View
Standalone View
Standalone View
src/parser/xhpast/__tests__/PHPASTParserTestCase.php
| Show All 27 Lines | private function executeParserTest($name, $data) { | ||||
| } | } | ||||
| $head = head($data); | $head = head($data); | ||||
| $body = last($data); | $body = last($data); | ||||
| if (!preg_match('/^#/', $head)) { | if (!preg_match('/^#/', $head)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Expected first line of parser test file "%s" to begin with "#" '. | 'Expected first line of parser test file "%s" to begin with `%s` '. | ||||
| 'and specify test options.', | 'and specify test options.', | ||||
| $name)); | $name, | ||||
| '#')); | |||||
| } | } | ||||
| $head = preg_replace('/^#\s*/', '', $head); | $head = preg_replace('/^#\s*/', '', $head); | ||||
| $options_parser = new PhutilSimpleOptions(); | $options_parser = new PhutilSimpleOptions(); | ||||
| $options = $options_parser->parse($head); | $options = $options_parser->parse($head); | ||||
| $type = null; | $type = null; | ||||
| ▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines | |||||