Clean up string processing: delimiters
First step in cleaning up string processing in the compiler. Define a unified String_kind.t as follows (replacing the existing delim type), make it mandatory and use it throughout the compiler pipeline (with the exception of the Parsetree for now).
type t =
| Standard (* Normal JS string with escaping *)
| Verbatim (* Literal quoted string for tags *)
| RawJs (* Raw JavaScript expressions *)
| Template (* Template literals *)
rescript
npm i https://pkg.pr.new/rescript-lang/rescript@7852
@rescript/darwin-arm64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7852
@rescript/darwin-x64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7852
@rescript/linux-arm64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7852
@rescript/linux-x64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7852
@rescript/runtime
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7852
@rescript/win32-x64
npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7852
commit: 7379d01
@codex review this change and explain the use of the various kinds of strings. Is this just a refactor or could it change anything observable? Make comments about style, clarity and possible simplifications.
@cristianoc For now it should be just a refactor that shouldn't change any behavior. I left out the Parsetree on purpose here as that's where things started breaking. 🙂 Can continue there later in a separate PR.