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

Fix and add patterns in language_java, language_kotlin and language_groovy. #475

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

PerilousBooklet
Copy link
Contributor

@PerilousBooklet PerilousBooklet commented Aug 10, 2024

You can test this PR with:

  • git clone https://github.com/PerilousBooklet/lite-xl-plugins.git
  • git fetch && git checkout PR_java_constants
  • lpm run --ephemeral ./ language_java

@PerilousBooklet PerilousBooklet marked this pull request as ready for review October 3, 2024 17:17
@PerilousBooklet
Copy link
Contributor Author

PerilousBooklet commented Nov 21, 2024

rescue tells me that the attack fails with [A-Z](?:A-Z_\d?)+(?=\s*[)]|[\;]|[\,]|[\s\=]|[\.]) .

@Guldoman
Copy link
Member

Yeah, but the regex in the PR is different.

@PerilousBooklet
Copy link
Contributor Author

The one in the PR is the the old one.

@PerilousBooklet PerilousBooklet marked this pull request as draft November 29, 2024 18:44
@PerilousBooklet PerilousBooklet marked this pull request as ready for review November 29, 2024 19:50
@PerilousBooklet PerilousBooklet marked this pull request as draft November 29, 2024 20:09
@PerilousBooklet PerilousBooklet changed the title Fix language_java constants pattern. Fix and add patterns in language_java, language_kotlin and language_groovy. Nov 30, 2024
@PerilousBooklet PerilousBooklet marked this pull request as ready for review December 14, 2024 12:40
@PerilousBooklet PerilousBooklet marked this pull request as draft December 16, 2024 11:08
@PerilousBooklet PerilousBooklet marked this pull request as ready for review December 29, 2024 14:20
Copy link
Member

@Guldoman Guldoman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we start using [[...]] for regexes? The escaping is way too much.

plugins/language_groovy.lua Outdated Show resolved Hide resolved
Comment on lines +16 to +18
{ pattern = "'\\x%x?%x?%x?%x'", type = "string" }, -- character hexadecimal escape sequence
{ pattern = "'\\u%x%x%x%x'", type = "string" }, -- character unicode escape sequence
{ pattern = "'\\?.'", type = "string" }, -- character literal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should those go above the preceding line?

Copy link
Contributor Author

@PerilousBooklet PerilousBooklet Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly I don't even know what that is.
I didn't write it.
I probably just commented it a few months ago or something like that.

plugins/language_kotlin.lua Outdated Show resolved Hide resolved
plugins/language_java.lua Outdated Show resolved Hide resolved
@PerilousBooklet
Copy link
Contributor Author

PerilousBooklet commented Jan 7, 2025

Sure, I'll replace the "..." with [[...]] in the next few days. I'll do one PR for the syntax plugins that I wrote in the past.
Should I also do it for all other syntax plugins ?
We may as well do it in one PR.

@Guldoman
Copy link
Member

Guldoman commented Jan 7, 2025

Should I also do it for all other syntax plugins ?

Yeah, we might as well.

@PerilousBooklet
Copy link
Contributor Author

Ok, now it should be much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants