diff options
| author | Alasdair Armstrong | 2018-01-16 15:34:03 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2018-01-16 18:05:13 +0000 |
| commit | ad78d4657ddf704633068872530ed2134a09406f (patch) | |
| tree | 891f8bedd29488047dde668d23fcd051dc2e278d /src/pretty_print_sail.ml | |
| parent | acb6db5a8d14e83e6d86d2ad2bf285ea931b518f (diff) | |
Created version of typecheck test suite for sail2 branch
Currently doesn't try to compile to lem or use the MIPS spec
All the failing tests have been removed because I intend to handle
them differently - they were very fragile before because there was no
indication of why they failed, so as sail evolved they tended to start
failing for the wrong reasons and not testing what they were supposed
to.
Diffstat (limited to 'src/pretty_print_sail.ml')
| -rw-r--r-- | src/pretty_print_sail.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pretty_print_sail.ml b/src/pretty_print_sail.ml index 930da39c..887b15a0 100644 --- a/src/pretty_print_sail.ml +++ b/src/pretty_print_sail.ml @@ -220,6 +220,7 @@ let rec doc_pat (P_aux (p_aux, _) as pat) = | P_wild -> string "_" | P_as (pat, id) -> separate space [doc_pat pat; string "as"; doc_id id] | P_app (id, pats) -> doc_id id ^^ parens (separate_map (comma ^^ space) doc_pat pats) + | P_list pats -> string "[|" ^^ separate_map (comma ^^ space) doc_pat pats ^^ string "|]" | _ -> string (string_of_pat pat) (* if_block_x is true if x should be printed like a block, i.e. with @@ -285,8 +286,8 @@ let rec doc_exp (E_aux (e_aux, _) as exp) = group (separate space [string "if"; doc_exp if_exp; string "then"; doc_exp then_exp; string "else"; doc_exp else_exp]) | E_list exps -> string "[|" ^^ separate_map (comma ^^ space) doc_exp exps ^^ string "|]" - | E_cons (exp1, exp2) -> string "E_cons" - | E_record fexps -> separate space [string "record"; string "{"; doc_fexps fexps; string "}"] + | E_cons (exp1, exp2) -> doc_atomic_exp exp1 ^^ space ^^ string "::" ^^ space ^^ doc_exp exp2 + | E_record fexps -> separate space [string "struct"; string "{"; doc_fexps fexps; string "}"] | E_loop (While, cond, exp) -> separate space [string "while"; doc_exp cond; string "do"; doc_exp exp] | E_loop (Until, cond, exp) -> |
