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

refactor: use trim_start_matches to remove tilde and at symbols #239

Merged
merged 2 commits into from
Mar 2, 2024

Conversation

lavafroth
Copy link
Contributor

Changes

  • Replaced the body of the strip_at function to call trim_start_matches on a string to strip the @ and ~ chars.
  • Removed obsolete strip_tilde function.
  • Cached the results of strip_at applied on token_new into tokens_no_at. The values are used in the subsequent for loop and for building the modifiers vector.

Tests are passing.

@Shinyzenith
Copy link
Member

CC: @angelofallars would you mind reviewing this? If not, I'll do the needful.

@Shinyzenith
Copy link
Member

CC: @zubairmh

@Shinyzenith
Copy link
Member

I approve these changes from my end but Ideally I think we shouldn't improve the hand rolled parser anymore -- the transition to the grammar based solution would be much better. Lets see what zubair thinks 😄

@Shinyzenith Shinyzenith merged commit a4d2ffe into waycrate:main Mar 2, 2024
7 checks passed
InnocentZero pushed a commit to InnocentZero/swhkd that referenced this pull request Mar 19, 2024
…ycrate#239)

* refactor: use `trim_start_matches` to remove tilde and at symbols

* lint: cargo clippy
InnocentZero pushed a commit to InnocentZero/swhkd that referenced this pull request Mar 26, 2024
…ycrate#239)

* refactor: use `trim_start_matches` to remove tilde and at symbols

* lint: cargo clippy
@lavafroth lavafroth deleted the trim-at-and-tilde branch April 9, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants