mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Make printing of comments inside bindings slightly less broken
This commit is contained in:
@@ -546,19 +546,9 @@ fn binop(rdr: &reader, op: token::binop) -> token::token {
|
||||
|
||||
tag 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
|
||||
|
||||
|
||||
|
||||
blank_line; // Just a manual blank linke "\n\n", for layout
|
||||
|
||||
blank_line; // Just a manual blank line "\n\n", for layout
|
||||
}
|
||||
|
||||
type cmnt = {style: cmnt_style, lines: str[], pos: uint};
|
||||
|
||||
@@ -174,7 +174,7 @@ fn bclose_(s: &ps, span: codemap::span, indented: uint) {
|
||||
|
||||
fn is_bol(s: &ps) -> bool {
|
||||
ret s.s.last_token() == pp::EOF ||
|
||||
s.s.last_token() == pp::hardbreak_tok();
|
||||
s.s.last_token() == pp::hardbreak_tok();
|
||||
}
|
||||
|
||||
fn hardbreak_if_not_bol(s: &ps) { if !is_bol(s) { hardbreak(s.s); } }
|
||||
@@ -1030,8 +1030,7 @@ fn print_local(s: &ps, loc: &@ast::local) {
|
||||
_ { }
|
||||
}
|
||||
}
|
||||
fn local_span(loc: &@ast::local) -> codemap::span { ret loc.span; }
|
||||
commasep_cmnt(s, consistent, locs, print_local, local_span);
|
||||
commasep(s, consistent, locs, print_local);
|
||||
end(s);
|
||||
}
|
||||
ast::decl_item(item) { print_item(s, item); }
|
||||
|
||||
Reference in New Issue
Block a user