# Syntax: Change rewrite arrow to `<-`
Description
This PR implements the enhancement requested in Issue #128.
Currently, both rewrites and implications use the same => syntax in Act specifications, which can be confusing. This PR changes the rewrite arrow to <- while keeping implications as =>, making specifications easier to write and read.
Changes
- Added a new
LARROWtoken to the lexer for the<-symbol - Updated the parser rule to use
<-instead of=>for rewrites - Modified the pretty printer to display rewrites with
<-instead of=>
Example
Before:
storage
balanceOf[CALLER] => balanceOf[CALLER] - value
balanceOf[to] => balanceOf[to] + value
After:
storage
balanceOf[CALLER] <- balanceOf[CALLER] - value
balanceOf[to] <- balanceOf[to] + value
This makes it easy to visually distinguish between rewrites (using <-) and implications (using =>).
Testing
I've verified that the changes properly handle the new syntax by:
- Adding the token to the lexer
- Updating the parser rule
- Modifying the pretty printer
The implementation is minimal and focused solely on addressing the syntax issue described in #128.
Related Issue
Resolves #128
Hi @mrscottyrose,
Thanks for the contribution! The updated syntax is definitely an improvement—it helps eliminate ambiguity and makes specifications easier to read.
That said, before we can merge this PR, all existing examples in the tests directory will need to be updated to use the new <- syntax. Otherwise, the CI tests will fail.
Just a quick note: Act is still under active development, and the syntax may undergo changes in the future.
Thanks again!
Hey @zoep could you please check if everything's alright now
The tests will still not pass as => should be replaced with <- in every file in the tests directory.
Hey @zoep Just to confirm—should I update every file and subdirectory under the tests directory where => is used, replacing it with <-, regardless of the file depth?
Yes, exactly. Eventually, CI must turn green.
hey @zoep I've updated all occurrences of => to <- across the entire tests directory . Despite this, the CI is still failing.
There is a build issue with the lexer. Have you tried building locally?
Thanks, @zoep! That definitely clarifies things. I’m currently on Windows, so I don’t have a proper Nix environment set up to test the build locally. I’ll rely on CI for now , let me know if there’s a better workaround you’d recommend.