Refactor AST APIs
Added public visibility to some constructors/accessors, and made child LValue nodes explicitly constructed by the caller rather than hidden inside constructors. This makes it easier to treat nodes as uniform dumb values. Also added some helpers.
RELNOTES: None
PiperOrigin-RevId: 158761415
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java b/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java
index 3951b2b..e6ef1ba 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/FunctionDefStatement.java
@@ -32,9 +32,9 @@
FunctionSignature.WithValues<Expression, Expression> signature,
Iterable<Statement> statements) {
this.ident = ident;
+ this.parameters = ImmutableList.copyOf(parameters);
this.signature = signature;
this.statements = ImmutableList.copyOf(statements);
- this.parameters = ImmutableList.copyOf(parameters);
}
@Override