diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-05-15 21:20:06 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-05-15 21:20:06 -0700 |
| commit | 7cd94d212361bc5662e8cc6959cd32edca1df03a (patch) | |
| tree | 7a5fe6aa6a2da5c6f160659c8b8894a93662d953 /src/Module.zig | |
| parent | dc036f5b6fde67c4a74701c75c5947a956abaec1 (diff) | |
| download | zig-7cd94d212361bc5662e8cc6959cd32edca1df03a.tar.gz zig-7cd94d212361bc5662e8cc6959cd32edca1df03a.zip | |
stage2: omit Decl compile errors from failed AstGen files
Just like when new parse errors occur during an update, when new AstGen
errors occur during an update, we do not reveal compile errors for Decl
objects which are inside of a newly failed File. Once the File passes
AstGen successfully, it will be compared with the previously succeeded
ZIR and the saved Decl compile errors will be handled properly.
Diffstat (limited to 'src/Module.zig')
| -rw-r--r-- | src/Module.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig index f31b243819..2227e47d72 100644 --- a/src/Module.zig +++ b/src/Module.zig @@ -1138,6 +1138,13 @@ pub const Scope = struct { const loc = std.zig.findLineColumn(file.source.bytes, src); std.debug.print("{s}:{d}:{d}\n", .{ file.sub_file_path, loc.line + 1, loc.column + 1 }); } + + pub fn okToReportErrors(file: File) bool { + return switch (file.status) { + .parse_failure, .astgen_failure => false, + else => true, + }; + } }; /// This is the context needed to semantically analyze ZIR instructions and |
