aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-02-11 10:15:58 +0000
committergingerBill <bill@gingerbill.org>2021-02-11 10:15:58 +0000
commitfa02dc97367fed2b487f53877ce3879d1769682b (patch)
treecc1c1bdc8db1491b52c6f562d1f3272b7e4479a0
parent92431c83ec03ef809cd7f9583093020839d290e8 (diff)
Fix #840
-rw-r--r--core/odin/parser/parser.odin4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin
index e5d74f049..fab822e1e 100644
--- a/core/odin/parser/parser.odin
+++ b/core/odin/parser/parser.odin
@@ -150,7 +150,7 @@ parse_file :: proc(p: ^Parser, file: ^ast.File) -> bool {
switch name := pkg_name.text; {
case is_blank_ident(name):
error(p, pkg_name.pos, "invalid package name '_'");
- case is_package_name_reserved(name), file.pkg.kind != .Runtime && name == "runtime":
+ case is_package_name_reserved(name), file.pkg != nil && file.pkg.kind != .Runtime && name == "runtime":
error(p, pkg_name.pos, "use of reserved package name '%s'", name);
}
}
@@ -3070,7 +3070,7 @@ parse_binary_expr :: proc(p: ^Parser, lhs: bool, prec_in: int) -> ^ast.Expr {
if expr == nil {
return ast.new(ast.Bad_Expr, start_pos, end_pos(p.prev_tok));
}
-
+
for prec := token_precedence(p, p.curr_tok.kind); prec >= prec_in; prec -= 1 {
for {
op := p.curr_tok;