From 4dc29d141f5423c6b0f8d963b60d18eee988a8ab Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Thu, 27 Jan 2022 14:24:33 +0100 Subject: [PATCH 1/3] Fix `core:odin/parser` not setting the inline flag correctly. --- core/odin/parser/parser.odin | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index e8c2c848d..56e1708e4 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -2168,7 +2168,7 @@ parse_inlining_operand :: proc(p: ^Parser, lhs: bool, tok: tokenizer.Token) -> ^ } switch e in &ast.unparen_expr(expr).derived { - case ast.Proc_Lit: + case ast.Proc_Lit: if e.inlining != .None && e.inlining != pi { error(p, expr.pos, "both 'inline' and 'no_inline' cannot be applied to a procedure literal") } @@ -2319,7 +2319,7 @@ parse_operand :: proc(p: ^Parser, lhs: bool) -> ^ast.Expr { return rt case "force_inline", "force_no_inline": - return parse_inlining_operand(p, lhs, tok) + return parse_inlining_operand(p, lhs, name) case: expr := parse_expr(p, lhs) te := ast.new(ast.Tag_Expr, tok.pos, expr.pos) From ff5e03677366141516b86783f4f3031c6f5e83ab Mon Sep 17 00:00:00 2001 From: Daniel Gavin Date: Thu, 27 Jan 2022 14:27:26 +0100 Subject: [PATCH 2/3] Trim whitespaces --- core/odin/parser/parser.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/odin/parser/parser.odin b/core/odin/parser/parser.odin index 56e1708e4..0ebabfd70 100644 --- a/core/odin/parser/parser.odin +++ b/core/odin/parser/parser.odin @@ -2168,7 +2168,7 @@ parse_inlining_operand :: proc(p: ^Parser, lhs: bool, tok: tokenizer.Token) -> ^ } switch e in &ast.unparen_expr(expr).derived { - case ast.Proc_Lit: + case ast.Proc_Lit: if e.inlining != .None && e.inlining != pi { error(p, expr.pos, "both 'inline' and 'no_inline' cannot be applied to a procedure literal") } From e190c024fd374aff56f8cd0cf81a16ef4b4b0542 Mon Sep 17 00:00:00 2001 From: Andrea Piseri Date: Wed, 2 Feb 2022 20:07:38 +0100 Subject: [PATCH 3/3] Fix logic in `is_nil` procedure: a non_nil slice means there is data to check. --- core/reflect/reflect.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/reflect/reflect.odin b/core/reflect/reflect.odin index 7f64d0974..05b3a5da0 100644 --- a/core/reflect/reflect.odin +++ b/core/reflect/reflect.odin @@ -234,7 +234,7 @@ is_nil :: proc(v: any) -> bool { return true } data := as_bytes(v) - if data != nil { + if data == nil { return true } for v in data {