bazel syntax: make Node.lnt final; pass LineNumberTable as ctor param
Also:
- make the field package-private (again). Unlike protected, this does not
expose the existence of the field in the Javadoc.
- rename 'LineNumberTable lnt' to 'FileLocations locs'.
- change Comment.text to include the leading # (to match its start-end range).
PiperOrigin-RevId: 305897033
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/Argument.java b/src/main/java/com/google/devtools/build/lib/syntax/Argument.java
index 37d2738..b80a2fe 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/Argument.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/Argument.java
@@ -26,7 +26,8 @@
protected final Expression value;
- Argument(Expression value) {
+ Argument(FileLocations locs, Expression value) {
+ super(locs);
this.value = Preconditions.checkNotNull(value);
}
@@ -47,8 +48,8 @@
/** Syntax node for a positional argument, {@code f(expr)}. */
public static final class Positional extends Argument {
- Positional(Expression value) {
- super(value);
+ Positional(FileLocations locs, Expression value) {
+ super(locs, value);
}
@Override
@@ -65,8 +66,8 @@
final Identifier id;
- Keyword(Identifier id, Expression value) {
- super(value);
+ Keyword(FileLocations locs, Identifier id, Expression value) {
+ super(locs, value);
this.id = id;
}
@@ -89,8 +90,8 @@
public static final class Star extends Argument {
private final int starOffset;
- Star(int starOffset, Expression value) {
- super(value);
+ Star(FileLocations locs, int starOffset, Expression value) {
+ super(locs, value);
this.starOffset = starOffset;
}
@@ -104,8 +105,8 @@
public static final class StarStar extends Argument {
private final int starStarOffset;
- StarStar(int starStarOffset, Expression value) {
- super(value);
+ StarStar(FileLocations locs, int starStarOffset, Expression value) {
+ super(locs, value);
this.starStarOffset = starStarOffset;
}