From 1c135a30506fcc87f5efa9001197a8930a860122 Mon Sep 17 00:00:00 2001 From: Jakub Doka Date: Sun, 17 Nov 2024 21:43:02 +0100 Subject: [PATCH] adding interesting asert --- lang/src/son.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lang/src/son.rs b/lang/src/son.rs index 7f7b2673..708554a4 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -24,6 +24,7 @@ use { fmt::{self, Debug, Display, Write}, format_args as fa, mem, ops::{self, Range}, + usize, }, hashbrown::hash_map, hbbytecode::DisasmError, @@ -2792,6 +2793,11 @@ impl<'a> Codegen<'a> { } } + debug_assert_eq!( + lexer::Lexer::new(&self.file().file[pos as usize..]).eat().kind, + TokenKind::Return + ); + let ret = self.ci.nodes.new_node_nop( ty::Id::VOID, Kind::Return { file: self.ci.file },