Skip to content

hexadecimal escapes#1

Merged
lmasroca merged 9 commits into
masterfrom
test
Oct 3, 2025
Merged

hexadecimal escapes#1
lmasroca merged 9 commits into
masterfrom
test

Conversation

@lmasroca

Copy link
Copy Markdown
Owner

added support for hexadecimal escapes (e.g.: "\x00", "\xFF", etc.)

@lmasroca lmasroca requested a review from jgaleotti September 19, 2025 20:47
@lmasroca lmasroca self-assigned this Sep 19, 2025

@Test
fun testHexEscape(){
checkSameAsJava("""\x00\x0a\xba\xFF""")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

are there any tests for "invalid" hex values?
What happens if "\xF" or "\xX" is tested?


val gene = RegexGene("regex", disjList,"${RegexGene.JAVA_REGEX_PREFIX}$text")
// we remove the <EOF> token from end of the string to store as sourceRegex
val gene = RegexGene("regex", disjList,"${RegexGene.JAVA_REGEX_PREFIX}${text.substring(0,text.length-5)}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of 5 use "".length to explain where the 5 comes from


val gene = RegexGene("regex", disjList,"${RegexGene.JAVA_REGEX_PREFIX}$text")
// we remove the <EOF> token from end of the string to store as sourceRegex
val gene = RegexGene("regex", disjList,"${RegexGene.JAVA_REGEX_PREFIX}${text.substring(0, text.length-5)}")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same as before

@lmasroca lmasroca merged commit bc2f5f6 into master Oct 3, 2025
14 checks passed
@lmasroca lmasroca deleted the test branch October 3, 2025 21:21
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