-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Rust-style raw string literals
For example, `r#"The word "this" is in quotes."#`. Implements #1422
- Loading branch information
Showing
6 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#check r###"this is a raw string, unterminated"## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
rawStringEOF.lean:1:7: error: unterminated raw string literal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
example : r"" = "" := rfl | ||
example : r#""# = "" := rfl | ||
example : r"hi" = "hi" := rfl | ||
example : r#"hi"# = "hi" := rfl | ||
example : r#""hello""# = "\"hello\"" := rfl | ||
example : r#""hello" said the world"# = "\"hello\" said the world" := rfl | ||
example : r#"""# = "\"" := rfl | ||
example : r"\n" = "\\n" := rfl | ||
example : r"\" = "\\" := rfl | ||
example : r#"#"# = "#" := rfl | ||
example : r##"need two #'s in "# to close"## = "need two #'s in \"# to close" := rfl | ||
example : r##"foo #"# bar"## = "foo #\"# bar" := rfl | ||
|
||
infix:100 " # " => Prod.mk | ||
|
||
example : r#"a"##"b" = ("a", "b") := rfl |