Repository: tweag/nickel (rust)

Issue:
Wrong handling of `#` character in multiline strings
**Describe the bug**
A `#` or a sequence of `#` in a multiline string causes a parse error.

**To Reproduce**
 ```
% nickel <<< 'm#"Hel#lo"#m'
error: Unexpected token
  ┌─ <stdin>:1:7
  │
1│ m#"Hel#lo"#m
  │       ^
```

**Expected behavior**
The program evaluates without error:
```
% nickel <<< 'm#"Hel#lo"#m'
Done: Str("Hel#lo")
```

Pull request description:
[Fix]Mishandling of `#` in mutliline strings
Close #230.

Patch:
diff --git a/src/parser/lexer.rs b/src/parser/lexer.rs
index 43b65e01..ca098a79 100644
--- a/src/parser/lexer.rs
+++ b/src/parser/lexer.rs
@@ -278,7 +278,7 @@ pub enum MultiStringToken<'input> {
     #[regex("\"#+m")]
     CandidateEnd(&'input str),
     // Same as `FalseEnd` and `CandidateEnd` but for an interpolation sequence.
-    #[token("#+")]
+    #[regex("#+")]
     FalseInterpolation(&'input str),
     #[regex("#+\\{")]
     CandidateInterpolation(&'input str),


Test patch:
diff --git a/src/parser/tests.rs b/src/parser/tests.rs
index 048c5261..6bcb6a40 100644
--- a/src/parser/tests.rs
+++ b/src/parser/tests.rs
@@ -281,3 +281,16 @@ fn str_escape() {
         mk_single_chunk("#a#b#c#{d#"),
     );
 }
+
+/// Regression test for [#230](https://github.com/tweag/nickel/issues/230).
+#[test]
+fn multiline_str_escape() {
+    assert_eq!(
+        parse_without_pos(r##"m#"#Hel##lo###"#m"##),
+        mk_single_chunk("#Hel##lo###"),
+    );
+    assert_eq!(
+        parse_without_pos(r##"m#"#Hel##{lo###{"#m"##),
+        mk_single_chunk("#Hel##{lo###{"),
+    );
+}