changeset 582:1ede8f8621cf default tip

Actually treat "0b" as 0 since it matches the "b" suffix for binary numbers
author William Astle <lost@l-w.ca>
date Thu, 08 Aug 2024 13:46:19 -0600
parents 10f8fc64481d
children
files lwasm/lwasm.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/lwasm.c	Thu Aug 08 13:40:00 2024 -0600
+++ b/lwasm/lwasm.c	Thu Aug 08 13:46:19 2024 -0600
@@ -649,8 +649,8 @@
 
 		if (**p != '0' && **p != '1')
 		{
-			(*p) -= 2;
-			return NULL;
+			// in this case, we have 0 (suffix notation 0b)
+			return lw_expr_build(lw_expr_type_int, 0);
 		}
 
 		while (**p && (**p == '0' || **p == '1'))