mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
Merge pull request #2160 from rtfeldman/editor-comments
support tld comments in docs and editor(reading only)
This commit is contained in:
commit
d6681f4e0a
21 changed files with 287 additions and 84 deletions
|
@ -406,6 +406,15 @@ impl<'a> CommentOrNewline<'a> {
|
|||
DocComment(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_string_repr(&self) -> std::string::String {
|
||||
use CommentOrNewline::*;
|
||||
match self {
|
||||
Newline => "\n".to_owned(),
|
||||
LineComment(comment_str) => format!("#{}", comment_str),
|
||||
DocComment(comment_str) => format!("##{}", comment_str),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue