Whitespace are not skipped when parsing a rule inside a quoted string escape sequence #248
Replies: 2 comments 1 reply
-
|
I notice that this issue isn't always present - for example this works: "\("John") has \(bananas) bananas and \(apples) apples, making a total of \(bananas + apples) fruits"But this does not: "'\("I have \(bananas + apples) fruits")' is what I would say if I had \(bananas + apples) fruits"However this does: "'\("I have \(bananas+apples) fruits")' is what I would say if I had \(bananas + apples) fruits"The first |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Sorry for the delay. This was in fact a bug in |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm trying to reproduce the string interpolation syntax from Swift:
let message = "Hello \(name)!"using Lexy.I was able to make it work with a backslash escape rule, with a parenthesized expression inside. It works fine except that whitespace skipping doesn't seem to be enabled back when parsing the expression rule.
I made this minimal reproduction project: https://lexy.foonathan.net/playground/?id=z5er56W1j&mode=trace
This parses fine:
But this does not (with spaces around the second
+):It says "expected )" right after the first
20, before the+.Why is that? Is there something I need to do to explicitely re-enable whitespace skipping while inside the escape rule? Or is that not something that's expected to work?
Beta Was this translation helpful? Give feedback.
All reactions