Skip to content

v2.0.0

Choose a tag to compare

@eventualbuddha eventualbuddha released this 22 Nov 17:11

<a name"2.0.0">

2.0.0 (2016-11-22)

Breaking Changes

  • The DSTRING and SSTRING token types have been removed, and strings now always start with STRING_START and end with STRING_END.

Progress toward decaffeinate/decaffeinate#557

Previously, if you had a string like "a#{b}c", it would lex like this:

DSTRING, INTERPOLATION_START, IDENTIFIER, INTERPOLATION_END, DSTRING

then the stringLocationsFromString function would do another pass and change
it to use STRING_START, STRING_CONTENT, and STRING_END. It would detect
the end of a string by finding a DSTRING not followed by an
INTERPOLATION_START.

Now, instead of that separate pass, we generate STRING_START, STRING_END,
and STRING_CONTENT nodes during the main lexing pass (for single and double
quoted strings) by tracking the type of string on a new stringStack. One nice
thing about this change is that there is no longer a distinction between strings
with interpolations and strings without interpolations; they always start with a
STRING_START and end with a STRING_END.

The plan for future commits is to change herestrings and heregexes to use this
same approach, and then to add a follow-up pass that changes the
STRING_CONTENT tokens into something more granular that expresses which parts
of the string should be trimmed.
(e4e2c88d)