diff options
author | 2015-08-07 15:22:35 +0000 | |
---|---|---|
committer | 2015-08-10 10:09:16 +0000 | |
commit | 0648018edabf426347dccdf36afba47650c17657 (patch) | |
tree | 6b6edb6fcb0f937817edc1564173a93b83c35d30 /src/main/java/com/google/devtools/build/lib/syntax | |
parent | 84a1278f24e350f57ab30142331b8bd698266cb2 (diff) |
Move skylark import dependency registration to after the preprocessor.
RELNOTES: allow load() in subincluded files.
--
MOS_MIGRATED_REVID=100125415
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java b/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java index 35a9af8477..e8f901b72c 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/BuildFileAST.java @@ -39,8 +39,6 @@ public class BuildFileAST extends ASTNode { private ImmutableSet<PathFragment> loads; - private ImmutableSet<String> subincludes; - private ImmutableSet<Label> includes; /** @@ -72,30 +70,6 @@ public class BuildFileAST extends ASTNode { } } - /** Collects labels from all subinclude statements */ - private ImmutableSet<String> fetchSubincludes(List<Statement> stmts) { - ImmutableSet.Builder<String> subincludes = new ImmutableSet.Builder<>(); - for (Statement stmt : stmts) { - // The code below matches: subinclude("literal string") - if (!(stmt instanceof ExpressionStatement)) { - continue; - } - Expression expr = ((ExpressionStatement) stmt).getExpression(); - if (!(expr instanceof FuncallExpression)) { - continue; - } - FuncallExpression call = (FuncallExpression) expr; - if (!call.getFunction().getName().equals("subinclude") || call.getArguments().size() != 1) { - continue; - } - Expression arg = call.getArguments().get(0).getValue(); - if (arg instanceof StringLiteral) { - subincludes.add(((StringLiteral) arg).getValue()); - } - } - return subincludes.build(); - } - private ImmutableSet<Label> fetchIncludes(List<Statement> stmts) { ImmutableSet.Builder<Label> result = new ImmutableSet.Builder<>(); for (Statement stmt : stmts) { @@ -175,16 +149,6 @@ public class BuildFileAST extends ASTNode { return loads; } - /** - * Returns a set of subincludes in this BUILD file. - */ - public synchronized ImmutableSet<String> getSubincludes() { - if (subincludes == null) { - subincludes = fetchSubincludes(stmts); - } - return subincludes; - } - public synchronized ImmutableSet<Label> getIncludes() { if (includes == null) { includes = fetchIncludes(stmts); |