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: Special characters get interpolated incorrectly #213

Merged

Conversation

Ph0enixKM
Copy link
Member

No description provided.

@Ph0enixKM Ph0enixKM linked an issue Jun 18, 2024 that may be closed by this pull request
@Ph0enixKM Ph0enixKM self-assigned this Jun 18, 2024
@Ph0enixKM Ph0enixKM requested review from arapower and b1ek June 18, 2024 13:44
@Ph0enixKM Ph0enixKM changed the title fix: dollar sign gets interpolated incorrectly fix: Special characters get interpolated incorrectly Jun 18, 2024
Comment on lines +81 to +87
'!' => {
if is_str {
result += "\"'!'\"";
} else {
result.push('!')
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Escaping ! with \ results in \!. We need to wrap it in the '!'literal

@arapower
Copy link
Contributor

arapower commented Jun 19, 2024

When I ran cargo test, I got the following failure.

failures:

---- tests::stdlib::input stdout ----
thread 'tests::stdlib::input' panicked at src/tests/stdlib.rs:57:5:
assertion `left == right` failed
  left: "Please enter your name:Hello, $REPLY"
 right: "Please enter your name:Hello, Amber"

However, it seems to have completed successfully in GitHub Actions.

@b1ek
Copy link
Member

b1ek commented Jun 19, 2024

std::stdlib::input fails for me as well, with the same data as @arapower:

thread 'tests::stdlib::input' panicked at src/tests/stdlib.rs:57:5:
assertion `left == right` failed
  left: "Please enter your name:Hello, $REPLY"
 right: "Please enter your name:Hello, Amber"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@b1ek
Copy link
Member

b1ek commented Jun 19, 2024

also this

image

@Ph0enixKM
Copy link
Member Author

also this

This issue is a Heraclitus bug. It has to be fixed in another PR amber-lang/heraclitus#48

@Ph0enixKM
Copy link
Member Author

@arapower @b1ek fixed the issue :)

Copy link
Contributor

@arapower arapower left a comment

Choose a reason for hiding this comment

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

LGTM

@Mte90
Copy link
Member

Mte90 commented Jul 9, 2024

@Ph0enixKM can you add more tests as I see in the code you check also for ``` symbol?
Also the conflicts needs to be fixed.

@Ph0enixKM
Copy link
Member Author

Conflicts resolved

@Mte90 Mte90 merged commit 5b7cb7b into master Jul 10, 2024
2 checks passed
@Mte90 Mte90 deleted the 212-dollar-sign-gets-interpolated-inside-of-text-literal branch July 10, 2024 09:30
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.

[Bug] Special characters get interpolated inside of Text literal
4 participants