bazel syntax: break dependency on lib.events.Event
This change removes nearly all dependencies on lib.event.Event,
in preparation for reversing the lib.syntax->lib.event dependency.
SyntaxError is renamed to SyntaxError.Exception, and SyntaxError
itself is a simple event-like location+message type.
PiperOrigin-RevId: 304262913
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/StarlarkFile.java b/src/main/java/com/google/devtools/build/lib/syntax/StarlarkFile.java
index c009711..b5d222d 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/StarlarkFile.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/StarlarkFile.java
@@ -15,7 +15,6 @@
import com.google.common.collect.ImmutableList;
import com.google.common.hash.HashCode;
-import com.google.devtools.build.lib.events.Event;
import java.io.IOException;
import java.util.Collections;
import java.util.List;
@@ -32,14 +31,14 @@
private final ImmutableList<Statement> statements;
private final FileOptions options;
private final ImmutableList<Comment> comments;
- final List<Event> errors; // appended to by ValidationEnvironment
+ final List<SyntaxError> errors; // appended to by ValidationEnvironment
@Nullable private final String contentHashCode;
private StarlarkFile(
ImmutableList<Statement> statements,
FileOptions options,
ImmutableList<Comment> comments,
- List<Event> errors,
+ List<SyntaxError> errors,
String contentHashCode,
Lexer.LexerLocation location) {
this.statements = statements;
@@ -81,7 +80,7 @@
* Returns an unmodifiable view of the list of scanner, parser, and (perhaps) resolver errors
* accumulated in this Starlark file.
*/
- public List<Event> errors() {
+ public List<SyntaxError> errors() {
return Collections.unmodifiableList(errors);
}