stage2: AST: clean up parse errors

* struct instead of tagged union
 * delete dead code
 * simplify parser code
 * remove unnecessary metaprogramming
This commit is contained in:
Andrew Kelley
2021-02-19 18:04:52 -07:00
parent 74878565e5
commit 8fee41b1d5
5 changed files with 389 additions and 607 deletions

View File

@@ -1723,7 +1723,7 @@ pub fn getAstTree(self: *Module, root_scope: *Scope.File) !*const ast.Tree {
err_msg.* = .{
.src_loc = .{
.file_scope = root_scope,
.byte_offset = tree.tokens.items(.start)[parse_err.loc()],
.byte_offset = tree.tokens.items(.start)[parse_err.token],
},
.msg = msg.toOwnedSlice(),
};