diff options
| author | Graydon Hoare <[email protected]> | 2010-09-14 10:52:32 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-09-14 10:52:32 -0700 |
| commit | 7287d3aaa0545a9b22cea874f2d751de4fefd23d (patch) | |
| tree | d35680fc38e9a559d466be476066bb34243415e2 /src/boot/fe/ast.ml | |
| parent | Update manual to cover change to nominal tag items. (diff) | |
| download | rust-7287d3aaa0545a9b22cea874f2d751de4fefd23d.tar.xz rust-7287d3aaa0545a9b22cea874f2d751de4fefd23d.zip | |
Teach front-end about simple, first-cut version of const items.
Diffstat (limited to 'src/boot/fe/ast.ml')
| -rw-r--r-- | src/boot/fe/ast.ml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml index 6e6483e3..b3a13df8 100644 --- a/src/boot/fe/ast.ml +++ b/src/boot/fe/ast.ml @@ -415,6 +415,7 @@ and mod_item' = | MOD_ITEM_mod of (mod_view * mod_items) | MOD_ITEM_fn of fn | MOD_ITEM_obj of obj + | MOD_ITEM_const of (ty * expr option) and mod_item_decl = { @@ -1438,6 +1439,18 @@ and fmt_mod_item (ff:Format.formatter) (id:ident) (item:mod_item) : unit = | MOD_ITEM_obj obj -> fmt_obj ff id params obj + + | MOD_ITEM_const (ty,e) -> + fmt ff "const "; + fmt_ty ff ty; + begin + match e with + None -> () + | Some e -> + fmt ff " = "; + fmt_expr ff e + end; + fmt ff ";" end and fmt_import (ff:Format.formatter) (ident:ident) (name:name) : unit = |