diff --git a/src/protocol/parser/pass_definitions.rs b/src/protocol/parser/pass_definitions.rs index e8c8b43705f8d4329dee6d197286f3467dec7a90..f1daca6c3081615e0dee6cdde1a16065d2eaf752 100644 --- a/src/protocol/parser/pass_definitions.rs +++ b/src/protocol/parser/pass_definitions.rs @@ -1523,11 +1523,25 @@ impl PassDefinitions { } else if next == Some(TokenKind::Integer) { let (literal, span) = consume_integer_literal(&module.source, iter, &mut self.buffer)?; + ctx.heap.alloc_literal_expression(|this| LiteralExpression { + this, + span, + value: Literal::Integer(LiteralInteger { unsigned_value: literal, negated: false }), + parent: ExpressionParent::None, + type_index: -1, + }).upcast() + } else if next == Some(TokenKind::Bytestring) { + let span = consume_bytestring_literal(&module.source, iter, &mut self.buffer)?; + let mut bytes = Vec::with_capacity(self.buffer.len()); + for byte in self.buffer.as_bytes().iter().copied() { + bytes.push(byte); + } + ctx.heap.alloc_literal_expression(|this| LiteralExpression{ this, span, - value: Literal::Integer(LiteralInteger{ unsigned_value: literal, negated: false }), + value: Literal::Bytestring(bytes), parent: ExpressionParent::None, - type_index: -1, + type_index: -1 }).upcast() } else if next == Some(TokenKind::String) { let span = consume_string_literal(&module.source, iter, &mut self.buffer)?;