Page MenuHomePhabricator

D12285.id29488.diff
No OneTemporary

D12285.id29488.diff

diff --git a/src/parser/xhpast/api/XHPASTTree.php b/src/parser/xhpast/api/XHPASTTree.php
--- a/src/parser/xhpast/api/XHPASTTree.php
+++ b/src/parser/xhpast/api/XHPASTTree.php
@@ -35,7 +35,8 @@
$tree = XHPASTTree::newFromData($string);
$statements = $tree->getRootNode()->selectDescendantsOfType('n_STATEMENT');
if (count($statements) != 1) {
- throw new Exception('String does not parse into exactly one statement!');
+ throw new Exception(
+ pht('String does not parse into exactly one statement!'));
}
// Return the first one, trying to use reset() with iterators ends in tears.
foreach ($statements as $statement) {
@@ -59,12 +60,16 @@
throw new XHPASTSyntaxErrorException($matches[2], trim($stderr));
}
}
- throw new Exception("XHPAST failed to parse file data {$err}: {$stderr}");
+ throw new Exception(
+ pht(
+ 'XHPAST failed to parse file data %d: %s',
+ $err,
+ $stderr));
}
$data = json_decode($stdout, true);
if (!is_array($data)) {
- throw new Exception('XHPAST: failed to decode tree.');
+ throw new Exception(pht('XHPAST: failed to decode tree.'));
}
return new XHPASTTree($data['tree'], $data['stream'], $php_source);

File Metadata

Mime Type
text/plain
Expires
Thu, May 16, 12:27 AM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6297186
Default Alt Text
D12285.id29488.diff (1 KB)

Event Timeline