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 no escaping for standard escapes in regular expressions #315

Merged
merged 8 commits into from
Aug 6, 2024

Conversation

jonassobotta
Copy link
Contributor

fixes #314

@jonassobotta
Copy link
Contributor Author

@wurzka @Markus1812 The failing test runs successfully when I run it locally with ABAP Unit. Do you have any ideas why it might fail in the gh action?

Copy link
Contributor

@wurzka wurzka left a comment

Choose a reason for hiding this comment

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

I had some detailed discussions with @Markus1812. Our result is:

  1. Replace \ with \\
  2. Replace " with \"

src/zcl_aff_abap_doc_parser.clas.abap Outdated Show resolved Hide resolved
src/zcl_aff_abap_doc_parser.clas.abap Outdated Show resolved Hide resolved
src/zcl_aff_test_types.clas.abap Outdated Show resolved Hide resolved
jonassobotta and others added 2 commits August 6, 2024 09:46
Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
@larshp
Copy link
Collaborator

larshp commented Aug 6, 2024

add a skip to https://github.com/SAP/abap-file-formats-tools/blob/fix-regex-escape-sequences/test/abap_transpile.json#L55 to make the unit tests succeed, I spend some time yesterday to try fixing the regex, but too much escaping of stuff

@jonassobotta
Copy link
Contributor Author

add a skip to https://github.com/SAP/abap-file-formats-tools/blob/fix-regex-escape-sequences/test/abap_transpile.json#L55 to make the unit tests succeed, I spend some time yesterday to try fixing the regex, but too much escaping of stuff

Thank you! @larshp

Copy link
Member

@Markus1812 Markus1812 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Maybe you could also include the escaping behavior of " in your new test.

Copy link
Contributor

@wurzka wurzka left a comment

Choose a reason for hiding this comment

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

Looks also good to me. But I agree with @Markus1812 about adding the test.

@jonassobotta
Copy link
Contributor Author

Looks also good to me. But I agree with @Markus1812 about adding the test.

I added the test and also verified that it works with a single quote '

@jonassobotta jonassobotta merged commit bd43f53 into main Aug 6, 2024
7 checks passed
@jonassobotta jonassobotta deleted the fix-regex-escape-sequences branch August 6, 2024 14:23
Copy link
Member

@Markus1812 Markus1812 left a comment

Choose a reason for hiding this comment

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

Achievement unlocked: @jonassobotta is now an escape master 😀

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.

No escaping for standard escapes in regular expressions
4 participants