From f7cface4cc30c24b5c60770b9449caa416e91157 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Fri, 7 Jul 2023 11:46:21 +1000 Subject: [PATCH] Support all values as keys in assembly --- valuescript_compiler/src/assembly_parser.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/valuescript_compiler/src/assembly_parser.rs b/valuescript_compiler/src/assembly_parser.rs index f89127f..c1e1942 100644 --- a/valuescript_compiler/src/assembly_parser.rs +++ b/valuescript_compiler/src/assembly_parser.rs @@ -985,24 +985,11 @@ impl<'a> AssemblyParser<'a> { let mut c = *self.pos.peek().expect("Expected object content or end"); let key = match c { - '"' => Value::String(self.parse_string_literal()), - '%' => Value::Register(self.assemble_register()), - '@' => { - self.parse_exact("@"); - let name = self.parse_identifier(); - Value::Pointer(Pointer { name }) - } - '$' => Value::Builtin(self.assemble_builtin()), '}' => { self.pos.next(); break object; } - _ => { - panic!( - "{}", - self.render_pos(0, &format!("Unexpected character {}", c)) - ); - } + _ => self.assemble_value(), }; self.parse_optional_whitespace();