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

Expand the 'reverse-string' analyzer #1

Open
ZapAnton opened this issue May 27, 2019 · 2 comments
Open

Expand the 'reverse-string' analyzer #1

ZapAnton opened this issue May 27, 2019 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@ZapAnton
Copy link
Contributor

ZapAnton commented May 27, 2019

The current version of the reverse-string analyzer does a very primitive version of the analysis - read the solution AST and compare it with a bunch of prepared ASTs to give a approve_as_optimal or approve_with_comment status.

The prepared ASTs can be viewed in the reverse-string README.

The following work should be done:

  • Make the AST analysis more thorough
  • Expand the approve solution list
  • Make the analyzer return the disapprove status
@ZapAnton
Copy link
Contributor Author

Future note: currently the following solution is not recognized as approve_as_optimal:

use unicode_segmentation::UnicodeSegmentation;
pub fn reverse(input: &str) -> String {
    UnicodeSegmentation::graphemes(input, true).rev().collect::<String>()
}

This is because the graphemes method is called via the crate name instead of input &str

@HarrisonMc555
Copy link
Contributor

I honestly have no idea if this is the case or not, and I don't have time to look into it right now, but from my experience with clippy there was a distinction between "early" passes and "late" passes...could a "late" pass be in such a format that everything is "desugared" and the function calls would be identical? Just a thought. Not sure if that's even available in the syn crate

P.S. Sorry for being MIA, I started a couple of other projects. I'd like to contribute some more but I also start a new job on Monday so I'm not sure how much time I'll have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants