core: Escape some characters in comments

This commit is contained in:
Brian Anderson
2012-03-16 11:58:39 -07:00
parent 67a1c35264
commit 0d88bf7e43

View File

@@ -517,13 +517,13 @@ fn split_str_nonempty(s: str, sep: str) -> [str] {
} }
#[doc = " #[doc = "
Splits a string into a vector of the substrings separated by LF ('\n') Splits a string into a vector of the substrings separated by LF ('\\n')
"] "]
fn lines(s: str) -> [str] { split_char(s, '\n') } fn lines(s: str) -> [str] { split_char(s, '\n') }
#[doc = " #[doc = "
Splits a string into a vector of the substrings separated by LF ('\n') Splits a string into a vector of the substrings separated by LF ('\\n')
and/or CR LF ('\r\n') and/or CR LF ('\\r\\n')
"] "]
fn lines_any(s: str) -> [str] { fn lines_any(s: str) -> [str] {
vec::map(lines(s), {|s| vec::map(lines(s), {|s|
@@ -664,7 +664,7 @@ fn words_iter(ss: str, ff: fn(&&str)) {
vec::iter(words(ss), ff) vec::iter(words(ss), ff)
} }
#[doc = "Apply a function to each lines (by '\n')"] #[doc = "Apply a function to each lines (by '\\n')"]
fn lines_iter(ss: str, ff: fn(&&str)) { fn lines_iter(ss: str, ff: fn(&&str)) {
vec::iter(lines(ss), ff) vec::iter(lines(ss), ff)
} }