nix-community / rnix-parser

A Nix parser written in Rust [maintainer=@oberblastmeister]
MIT License
365 stars 44 forks source link

Fix multiline dollar escape #102

Closed darichey closed 2 years ago

darichey commented 2 years ago

Summary & Motivation

Previously, if the tokenizer encountered the sequence of characters ''\$, next_string would consume the first 3 and then loop back around and see the $ next, which it treated as the start of an interpolation.

With this change, it will instead always immediately consume the next character after ''\ before looping back. This is correct, because ''\x is a valid escape sequence for any x.

Further context

Fixes #100

oberblastmeister commented 2 years ago

This looks good, thanks for the fix!