Skip to content

Commit

Permalink
handle program literals for addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
mikebenfield committed Dec 9, 2024
1 parent d45cd77 commit 42c37a9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion interpreter/src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,14 @@ impl<'a> Cursor<'a> {
GroupLiteral::Single(s, ..) => Value::Group(format!("{s}group").parse().expect_tc(literal.span())?),
GroupLiteral::Tuple(_group_tuple) => todo!(),
},
Literal::Address(s, ..) => Value::Address(s.parse().expect_tc(literal.span())?),
Literal::Address(s, ..) => {
if s.ends_with(".aleo") {
let program_id = ProgramID::from_str(s)?;
Value::Address(program_id.to_address()?)
} else {
Value::Address(s.parse().expect_tc(literal.span())?)
}
}
Literal::Scalar(s, ..) => Value::Scalar(format!("{s}scalar").parse().expect_tc(literal.span())?),
Literal::String(..) => tc_fail!(),
}),
Expand Down

0 comments on commit 42c37a9

Please sign in to comment.