Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved ReSearchingLiteralRule by giving an example in description & added automatic transformation #18032

Open
wants to merge 2 commits into
base: Pharo13
Choose a base branch
from

Conversation

Alokzh
Copy link
Contributor

@Alokzh Alokzh commented Mar 22, 2025

Fixes: #18021

Changes:

  1. Added an example in description of ReSearchingLiteralRule.
  2. Implemented automatic transformation to make sure that repeated literal equality tests are replaced with a more efficient includes: method on a literal array

Testing:

  1. All testcase pass locally
  2. Verified the transformations with some examples locally

Screencast:

Screencast.from.22-03-25.12.47.48.PM.IST.webm

@jecisc
Copy link
Member

jecisc commented Mar 24, 2025

There is a failing test:

image

@jecisc jecisc added the Status: Need more work The issue is nearly ready. Waiting some last bits. label Mar 24, 2025
@Alokzh
Copy link
Contributor Author

Alokzh commented Mar 25, 2025

@jecisc Rule was not able to handle the complex comparisons such as empty collections (#()), so I added that & now it works

Here was the code in RBSmalllintTestObject class due to which test was failing

searchingLiteral
	^ self printString = #a or: [
		  #(  ) = self printString | (#(  ) == self printString) ]
		  

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Need more work The issue is nearly ready. Waiting some last bits.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve description of ReSearchingLiteralRule
2 participants