aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Walton <[email protected]>2010-07-02 11:54:07 -0700
committerPatrick Walton <[email protected]>2010-07-02 11:57:04 -0700
commita3431335118a00130de16857dc3d5e6d0c90c074 (patch)
tree219cef2e9e42c21ed1a6b51f579aecba00a5a769 /src
parentGut the box[m][o] family from util. (diff)
downloadrust-a3431335118a00130de16857dc3d5e6d0c90c074.tar.xz
rust-a3431335118a00130de16857dc3d5e6d0c90c074.zip
Allow formatting individual decl_params
Diffstat (limited to 'src')
-rw-r--r--src/boot/fe/ast.ml14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml
index 6962a9e0..7f577427 100644
--- a/src/boot/fe/ast.ml
+++ b/src/boot/fe/ast.ml
@@ -1180,6 +1180,13 @@ and fmt_stmt_body (ff:Format.formatter) (s:stmt) : unit =
| STMT_slice _ -> fmt ff "?stmt_slice?"
end
+and fmt_decl_param (ff:Format.formatter) (param:ty_param) : unit =
+ let (ident, (i, e)) = param in
+ fmt_effect ff e;
+ if e <> PURE then fmt ff " ";
+ fmt_ident ff ident;
+ fmt ff "=<p#%d>" i
+
and fmt_decl_params (ff:Format.formatter) (params:ty_param array) : unit =
if Array.length params = 0
then ()
@@ -1190,11 +1197,7 @@ and fmt_decl_params (ff:Format.formatter) (params:ty_param array) : unit =
do
if i <> 0
then fmt ff ", ";
- let (ident, (i, e)) = params.(i) in
- fmt_effect ff e;
- if e <> PURE then fmt ff " ";
- fmt_ident ff ident;
- fmt ff "=<p#%d>" i
+ fmt_decl_param ff params.(i)
done;
fmt ff "]"
end;
@@ -1347,6 +1350,7 @@ let sprintf_tag = sprintf_fmt fmt_tag;;
let sprintf_carg = sprintf_fmt fmt_carg;;
let sprintf_constr = sprintf_fmt fmt_constr;;
let sprintf_mod_items = sprintf_fmt fmt_mod_items;;
+let sprintf_decl_param = sprintf_fmt fmt_decl_param;;
let sprintf_decl_params = sprintf_fmt fmt_decl_params;;
let sprintf_app_args = sprintf_fmt fmt_app_args;;