Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15511476
D14107.id34094.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
676 B
Referenced Files
None
Subscribers
None
D14107.id34094.diff
View Options
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
@@ -257,7 +257,7 @@
$left = head($tokens);
while ($left &&
- (!$left->isAnyWhitespace() ||
+ (!($left->isAnyWhitespace() || $left->isComment()) ||
strpos($left->getValue(), "\n") === false)) {
$left = $left->getPrevToken();
}
@@ -266,6 +266,11 @@
return null;
}
+ $next = $left->getNextToken();
+ if ($next->isAnyWhitespace()) {
+ return $next->getValue();
+ }
+
return preg_replace("/^.*\n/s", '', $left->getValue());
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 18, 2:35 AM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7740260
Default Alt Text
D14107.id34094.diff (676 B)
Attached To
Mode
D14107: Fix wrong indentation returned by AASTNode::getIndentation() when calling it on a statement node that is preceded by a comment token.
Attached
Detach File
Event Timeline
Log In to Comment