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

Ensure that multiline strings and escapes work as expected #170

Merged
merged 1 commit into from
Feb 11, 2023

Conversation

jmackie
Copy link
Member

@jmackie jmackie commented Jan 13, 2023

Check that some fancier features of string literals work as expected.

This is in anticipation of #65 👀

@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #170 (1313a60) into main (2060206) will not change coverage.
The diff coverage is 33.33%.

@@           Coverage Diff           @@
##             main     #170   +/-   ##
=======================================
  Coverage   84.13%   84.13%           
=======================================
  Files          83       83           
  Lines       15369    15369           
=======================================
  Hits        12931    12931           
  Misses       2438     2438           
Impacted Files Coverage Δ
crates/ditto-cst/src/lexer.rs 63.20% <0.00%> (ø)
crates/ditto-codegen-js/src/render.rs 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@@ -203,7 +203,7 @@ impl Render for Expression {
}
Self::String(inner_string) => {
accum.push('"');
accum.push_str(inner_string);
accum.push_str(&inner_string.replace('\n', "\\n"));
Copy link
Member Author

Choose a reason for hiding this comment

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

The alternative here is that we use backquoted JavaScript strings?

@jmackie jmackie merged commit e7e1991 into main Feb 11, 2023
@jmackie jmackie deleted the fix-string-literals branch February 11, 2023 13:09
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.

None yet

1 participant