Skip to content

Commit

Permalink
fix: Use the DSL v1 mechanism for versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Nov 10, 2023
1 parent f257e9e commit ecc48e1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crates/solidity/inputs/language/src/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,10 +575,15 @@ fn resolve_precedence(
OnceCell::new(),
));

// NOTE: The DSL v1 model defines operators as having the same body definitions but uses a specific
// versioning mechanism. This is in contrast to the DSL v2, which allows for different body definitions and
// different versions.
// Thus, we shoehorn the v2 model into the first one, by creating a single parser definition node as
// a choice over the different versions of the operator body, but still define it multiple times in the DSL v1
// model with an explicit version, that the codegen handles for us.
for op in &expr.operators {
operators.push((
// Parser definition done below is already taking care of versioning
vec![],
op.enabled.clone().map(enabled_to_range).unwrap_or_default(),
model_to_enum(op.model),
// TODO: Don't leak
expr.rule_name.to_string().leak() as &_,
Expand Down

0 comments on commit ecc48e1

Please sign in to comment.