Skip to content

Commit

Permalink
Support all values as keys in assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
voltrevo committed Jul 7, 2023
1 parent 8e5f41c commit f7cface
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions valuescript_compiler/src/assembly_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f7cface

Please sign in to comment.