Repository navigation
Fixed confusion on memo configuration - #2948
Merged
Merged
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2948 +/- ##
=======================================
- Coverage 45% 45% -1%
+ Complexity 6815 6811 -4
=======================================
Files 844 844
Lines 68823 68826 +3
Branches 10038 10040 +2
=======================================
- Hits 31432 31420 -12
- Misses 34995 35008 +13
- Partials 2396 2398 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
toinehartman
added a commit
to usethesource/rascal-language-servers
that referenced
this pull request
Oct 23, 2026
toinehartman
added a commit
to usethesource/rascal-language-servers
that referenced
this pull request
Oct 23, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Design
When we introduced a ADT for configuring the
@memocaching feature (18e0bb7), we had to be compatible with the existing tag feature in rascal, as such we used the@<tag> = <expression>feature. So@memo=maximumSize(400)could be written by a user and get their intended behavior. But what if you wanted to combine expiration policies? Well@memo={maximumSize(400), expireAfter(minutes=2)}was the syntax. If you forgot to import theutil::Memoyou would get a warning on that at import time.The problem
But this looks very much like most other tags that use the
@<tag>{<string>}. So in most places people had the wrong@memo{maximumSize(400), expireAfter(minutes=2)}. Which in the interpreter while parsing these tags, we just ignored, as that was a string, and we only matched on theMemoExpireConfigurationadt.The compiler has now implemented the memo feature in an adhoc way by regex matching on the string, so both
@memo=and@memo{work the same way, but the ADT is hard-coded in the compiler.The fix
The interpreter has gotten a warning if the string version is used, and i've rewritten all the caches in the rascal project to use the right configuration.
The typechecker might benefit from specifically recognizing that
@memoshould not be a string value, but that's a new issue.