-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #733 from powdr-labs/parse_next_as_operator
Parse next as operator
- Loading branch information
Showing
18 changed files
with
148 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,18 @@ | ||
use crate::parsed::Expression; | ||
|
||
use super::PolynomialReference; | ||
use super::{PolynomialReference, UnaryOperator}; | ||
|
||
pub fn direct_reference<S: Into<String>, T>(name: S) -> Expression<T> { | ||
PolynomialReference::new(name) | ||
.single() | ||
.local() | ||
.current() | ||
.into() | ||
PolynomialReference::new(name).single().local().into() | ||
} | ||
|
||
pub fn namespaced_reference<S: Into<String>, T>(namespace: String, name: S) -> Expression<T> { | ||
PolynomialReference::new(name) | ||
.single() | ||
.namespaced(namespace) | ||
.current() | ||
.into() | ||
} | ||
|
||
pub fn next_reference<T>(name: &str) -> Expression<T> { | ||
PolynomialReference::new(name) | ||
.single() | ||
.local() | ||
.next() | ||
.into() | ||
Expression::UnaryOperation(UnaryOperator::Next, Box::new(direct_reference(name))) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.