mirror of
https://github.com/powdr-labs/powdr.git
synced 2026-04-20 03:03:25 -04:00
Change intermediate column syntax. (#1630)
Fixes #1190 Fixes https://github.com/powdr-labs/powdr/issues/1488 ``` // creates intermediate column. let x: inter = ... // same here, expects an array on the rhs let x: inter[k] = ... // Creates an intermediate column, this is printed from Analyzed col x = ...; // Creates an array of intermediate columns, this is printed from analyzed and it's actually new syntax. col x[k] = ...; // old syntax for intermediate columns, this just defines a "generic variable" after the change, // essentially an intermediate column that is always inlined. let x: expr = ...; ``` --------- Co-authored-by: Leo <leo@powdrlabs.com>
This commit is contained in:
@@ -142,7 +142,7 @@ LetStatement: PilStatement = {
|
||||
}
|
||||
|
||||
PolynomialDefinition: PilStatement = {
|
||||
<start:@L> PolCol <id:Identifier> "=" <expr:Expression> <end:@R> ";" => PilStatement::PolynomialDefinition(ctx.source_ref(start, end), id, expr)
|
||||
<start:@L> PolCol <name:PolynomialName> "=" <expr:Expression> <end:@R> ";" => PilStatement::PolynomialDefinition(ctx.source_ref(start, end), name, expr)
|
||||
}
|
||||
|
||||
PublicDeclaration: PilStatement = {
|
||||
@@ -777,6 +777,7 @@ TypeTerm<ArrayLength>: Type<ArrayLength> = {
|
||||
"fe" => Type::Fe,
|
||||
"string" => Type::String,
|
||||
"col" => Type::Col,
|
||||
"inter" => Type::Inter,
|
||||
"expr" => Type::Expr,
|
||||
<base:TypeTerm<ArrayLength>> "[" <length:ArrayLength?> "]" => Type::Array(ArrayType{base: Box::new(base), length}),
|
||||
"(" <mut items:( <TypeTerm<ArrayLength>> "," )+> <end:TypeTerm<ArrayLength>> ")" => { items.push(end); Type::Tuple(TupleType{items}) },
|
||||
@@ -845,6 +846,7 @@ SpecialIdentifier: &'input str = {
|
||||
"loc",
|
||||
"insn",
|
||||
"int",
|
||||
"inter",
|
||||
"fe",
|
||||
"expr",
|
||||
"bool",
|
||||
|
||||
Reference in New Issue
Block a user