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 a number of TODOs in ToMathematica and friends #2546

Merged
merged 2 commits into from
Apr 26, 2020

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Apr 26, 2020

No description provided.

break;
case '\t':
result += "\\t";
break;
Copy link
Member

Choose a reason for hiding this comment

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

Mathematica string literals are multiline and can contain tabs; let’s not escape what we don’t need, otherwise we have to worry about other escapes for control characters, e.g., \r, but also \[RawEscape] (and then there are the control characters characters for which Mathematica has no escape, e.g. FromCharacterCode[7]). Only " and \ should be escaped.

Sorry, something went wrong.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Sorry, something went wrong.

EXPECT_EQ("\"fo\\\\o\"", Escape("fo\\o"));
EXPECT_EQ("\"fo\\no\"", Escape("fo\no"));
EXPECT_EQ("\"fo\\to\"", Escape("fo\to"));
EXPECT_EQ("\"\"", Escape(""));
Copy link
Member

Choose a reason for hiding this comment

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

Raw strings for the expected values; https://xkcd.com/1638/.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done (but one of them confuses the macro).

@eggrobin eggrobin added the LGTM label Apr 26, 2020
@pleroy pleroy merged commit c65fa7b into mockingbirdnest:master Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants