diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-07-26 15:58:43 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-07-26 15:58:50 -0700 |
| commit | 4070b75914cd3b6b891aa5868e77c1921e76eb62 (patch) | |
| tree | 5904503bba458019ba8b2514840c51036e314490 | |
| parent | e1769ab76f4e6c29b85e0dbc80e04af8b32fe44a (diff) | |
| download | rust-4070b75914cd3b6b891aa5868e77c1921e76eb62.tar.gz rust-4070b75914cd3b6b891aa5868e77c1921e76eb62.zip | |
Prohibit breaking between "let" and "=" in local decls.
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index a59febf05fb..fb27b2ebd1a 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -147,7 +147,9 @@ fn box(&ps s, uint u, pp::breaks b) { pp::box(s.s, u, b); } -fn word_nbsp(&ps s, str w) { word(s.s, w); word(s.s, " "); } +fn nbsp(&ps s) { word(s.s, " "); } + +fn word_nbsp(&ps s, str w) { word(s.s, w); nbsp(s); } fn word_space(&ps s, str w) { word(s.s, w); space(s.s); } @@ -1064,7 +1066,7 @@ fn print_decl(&ps s, &@ast::decl decl) { } alt loc.node.init { some(?init) { - space(s.s); + nbsp(s); alt init.op { ast::init_assign { word_space(s, "="); } ast::init_move { word_space(s, "<-"); } |
