You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds support for serializing interpolated strings. The structure
of interpolated strings is a bit special compared to other nodes: we
store the string literal parts and the expression parts independently.
The visitor must account for this so that parts are visited in the
correct order.
We implement a special printer for interpolated strings, similar to how
we've implemented it for other strings. We are guaranteed that an
interpolated string starts and ends with a string literal (potentially
empty), so the leading trivia of the first literal and trailing trivia
of the last literal become the trivia for the overall interpolated
string.
Note that the characters `` ` `` , `{` and `}` are not stored anywhere
as part of the CST. To ensure correct trivia attachment to tokens, we
need to ensure that the end position of the string part is computed
correctly. We manually increment current position to do this.
0 commit comments