Page MenuHomePhabricator

D12295.diff
No OneTemporary

D12295.diff

diff --git a/src/parser/aast/api/AASTNode.php b/src/parser/aast/api/AASTNode.php
--- a/src/parser/aast/api/AASTNode.php
+++ b/src/parser/aast/api/AASTNode.php
@@ -239,6 +239,23 @@
return implode('', mpull($tokens, 'getValue'));
}
+ public function getIndentation() {
+ $tokens = $this->getTokens();
+ $left = head($tokens);
+
+ while ($left &&
+ (!$left->isAnyWhitespace() ||
+ strpos($left->getValue(), "\n") === false)) {
+ $left = $left->getPrevToken();
+ }
+
+ if (!$left) {
+ return null;
+ }
+
+ return preg_replace("/^.*\n/s", '', $left->getValue());
+ }
+
public function getDescription() {
$concrete = $this->getConcreteString();
if (strlen($concrete) > 75) {

File Metadata

Mime Type
text/plain
Expires
Sun, May 19, 9:23 AM (1 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6293200
Default Alt Text
D12295.diff (747 B)

Event Timeline