Page MenuHomePhabricator

D12295.id.diff
No OneTemporary

D12295.id.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
Fri, Nov 15, 3:37 AM (12 h, 55 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6719877
Default Alt Text
D12295.id.diff (747 B)

Event Timeline