]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Allow pht(<<<HEREDOC ... HEREDOC)
authorepriestley <git@epriestley.com>
Wed, 16 Jan 2013 22:57:10 +0000 (14:57 -0800)
committerepriestley <git@epriestley.com>
Wed, 16 Jan 2013 22:57:10 +0000 (14:57 -0800)
Summary: Don't raise lint on heredoc literals.

Test Plan: Linted pht() + heredoc in D4477.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran
Differential Revision: https://secure.phabricator.com/D4478

src/lint/linter/ArcanistXHPASTLinter.php

index 6418b9b01a32c84b422b12e78102d7811c67e4ed..a65fdbe7f382922db5e961812ac29192a546a10a 100644 (file)
@@ -294,8 +294,13 @@ final class ArcanistXHPASTLinter extends ArcanistLinter {
         continue;
       }
 
+      // TODO: Desceptively, n_STRING_SCALAR may include variables, mostly
+      // because I was lazy when implementing the parser. We should perform more
+      // strict checks here, and/or enhance the parser.
+
       $identifier = $parameters->getChildByIndex(0);
-      if ($identifier->getTypeName() == 'n_STRING_SCALAR') {
+      if ($identifier->getTypeName() == 'n_STRING_SCALAR' ||
+          $identifier->getTypeName() == 'n_HEREDOC') {
         continue;
       }