Fix primary

This commit is contained in:
2026-05-05 14:45:30 +02:00
parent e421a81a3d
commit 3f3498c338
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -334,9 +334,10 @@ impl From<pest::iterators::Pair<'_, Rule>> for Statement {
impl From<pest::iterators::Pair<'_, Rule>> for Literal { impl From<pest::iterators::Pair<'_, Rule>> for Literal {
fn from(pair: pest::iterators::Pair<'_, Rule>) -> Self { fn from(pair: pest::iterators::Pair<'_, Rule>) -> Self {
let rule = pair.as_rule(); let rule = pair.as_rule();
let inner = pair.clone().into_inner(); let mut inner = pair.clone().into_inner();
match rule { match rule {
Rule::primary => Self::from(inner.next().unwrap()),
Rule::integer => Literal::Int(pair.as_str().parse::<i64>().unwrap()), Rule::integer => Literal::Int(pair.as_str().parse::<i64>().unwrap()),
Rule::float => Literal::Float(pair.as_str().parse::<f64>().unwrap()), Rule::float => Literal::Float(pair.as_str().parse::<f64>().unwrap()),
Rule::boolean => Literal::Bool(pair.as_str().parse::<bool>().unwrap()), Rule::boolean => Literal::Bool(pair.as_str().parse::<bool>().unwrap()),
+1 -1
View File
@@ -1,4 +1,4 @@
#[test] #[derive(Debug)]
public struct ApiCall { public struct ApiCall {
i32 x, i32 x,
i32 y, i32 y,