diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-01-29 13:54:06 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-01-29 13:55:30 -0800 |
| commit | 95b892c8a723ad88e868e3914c3d29a585008ac2 (patch) | |
| tree | fba7ee4b435c020fb862bda4c932f80bdbf1caf1 /src/libsyntax/parse/comments.rs | |
| parent | 66b07f1e5dd5767ae6aa238a00490f1493c5d443 (diff) | |
| download | rust-95b892c8a723ad88e868e3914c3d29a585008ac2.tar.gz rust-95b892c8a723ad88e868e3914c3d29a585008ac2.zip | |
libsyntax: De-export a lot of libsyntax. rs=deƫxporting
Diffstat (limited to 'src/libsyntax/parse/comments.rs')
| -rw-r--r-- | src/libsyntax/parse/comments.rs | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index fbe258852e2..26de85548e1 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -27,14 +27,7 @@ use core::str; use core::uint; use core::vec; -export cmnt; -export lit; -export cmnt_style; -export gather_comments_and_literals; -export is_doc_comment, doc_comment_style, strip_doc_comment_decoration; -export isolated, trailing, mixed, blank_line; - -enum cmnt_style { +pub enum cmnt_style { isolated, // No code on either side of each line of the comment trailing, // Code exists to the left of the comment mixed, // Code before /* foo */ and after the comment @@ -50,16 +43,16 @@ impl cmnt_style : cmp::Eq { } } -type cmnt = {style: cmnt_style, lines: ~[~str], pos: BytePos}; +pub type cmnt = {style: cmnt_style, lines: ~[~str], pos: BytePos}; -fn is_doc_comment(s: ~str) -> bool { +pub fn is_doc_comment(s: ~str) -> bool { s.starts_with(~"///") || s.starts_with(~"//!") || s.starts_with(~"/**") || s.starts_with(~"/*!") } -fn doc_comment_style(comment: ~str) -> ast::attr_style { +pub fn doc_comment_style(comment: ~str) -> ast::attr_style { assert is_doc_comment(comment); if comment.starts_with(~"//!") || comment.starts_with(~"/*!") { ast::attr_inner @@ -68,7 +61,7 @@ fn doc_comment_style(comment: ~str) -> ast::attr_style { } } -fn strip_doc_comment_decoration(comment: ~str) -> ~str { +pub fn strip_doc_comment_decoration(comment: ~str) -> ~str { /// remove whitespace-only lines from the start/end of lines fn vertical_trim(lines: ~[~str]) -> ~[~str] { @@ -306,11 +299,11 @@ fn consume_comment(rdr: string_reader, code_to_the_left: bool, debug!("<<< consume comment"); } -type lit = {lit: ~str, pos: BytePos}; +pub type lit = {lit: ~str, pos: BytePos}; -fn gather_comments_and_literals(span_diagnostic: diagnostic::span_handler, - path: ~str, - srdr: io::Reader) -> +pub fn gather_comments_and_literals(span_diagnostic: diagnostic::span_handler, + path: ~str, + srdr: io::Reader) -> {cmnts: ~[cmnt], lits: ~[lit]} { let src = @str::from_bytes(srdr.read_whole_stream()); let itr = parse::token::mk_fake_ident_interner(); |
