Ignore:
Timestamp:
Oct 17, 2011, 2:08:27 PM (9 years ago)
Author:
tranquil
Message:

fiddling with Cminor: elimination of loops, blocks and exits

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-indexed-labels-branch/src/LIN/LINPrinter.ml

    r1349 r1392  
    33
    44
    5 let n_spaces n = String.make n ' '
     5let n_spaces ?stmt n =
     6        let n = match stmt with
     7                | Some (LIN.St_label _) | Some (LIN.St_cost _) -> n - 2
     8                | _ -> n in
     9        String.make n ' '
    610
    711
     
    6670let print_code n c =
    6771  let f s stmt =
    68     Printf.sprintf "%s\n%s%s" s (n_spaces n) (print_statement stmt) in
     72    Printf.sprintf "%s\n%s%s" s (n_spaces ~stmt:stmt n) (print_statement stmt) in
    6973  List.fold_left f "" c
    7074
Note: See TracChangeset for help on using the changeset viewer.