Mercurial > urweb
comparison src/mono_util.sml @ 2251:25874084bf1f
Make Mono.file a record for readability upon extension.
author | Ziv Scully <ziv@mit.edu> |
---|---|
date | Sun, 13 Sep 2015 17:02:17 -0400 |
parents | 278e10629ba1 |
children | e843a04499d4 |
comparison
equal
deleted
inserted
replaced
2250:c275bbc41194 | 2251:25874084bf1f |
---|---|
693 | 693 |
694 fun mapfoldB (all as {bind, ...}) = | 694 fun mapfoldB (all as {bind, ...}) = |
695 let | 695 let |
696 val mfd = Decl.mapfoldB all | 696 val mfd = Decl.mapfoldB all |
697 | 697 |
698 fun mff ctx (ds, ps) = | 698 fun mff ctx (file : file) = |
699 case ds of | 699 case #decls file of |
700 nil => S.return2 (nil, ps) | 700 nil => S.return2 {decls = nil, sideInfo = #sideInfo file} |
701 | d :: ds' => | 701 | d :: ds' => |
702 S.bind2 (mfd ctx d, | 702 S.bind2 (mfd ctx d, |
703 fn d' => | 703 fn d' => |
704 let | 704 let |
705 val ctx' = | 705 val ctx' = |
734 | DStyle _ => ctx | 734 | DStyle _ => ctx |
735 | DTask _ => ctx | 735 | DTask _ => ctx |
736 | DPolicy _ => ctx | 736 | DPolicy _ => ctx |
737 | DOnError _ => ctx | 737 | DOnError _ => ctx |
738 in | 738 in |
739 S.map2 (mff ctx' (ds', ps), | 739 S.map2 (mff ctx' {decls = ds', sideInfo = #sideInfo file}, |
740 fn (ds', _) => | 740 fn {decls = ds', ...} => |
741 (d' :: ds', ps)) | 741 {decls = d' :: ds', sideInfo = #sideInfo file}) |
742 end) | 742 end) |
743 in | 743 in |
744 mff | 744 mff |
745 end | 745 end |
746 | 746 |
789 | DJavaScript _ => count | 789 | DJavaScript _ => count |
790 | DCookie _ => count | 790 | DCookie _ => count |
791 | DStyle _ => count | 791 | DStyle _ => count |
792 | DTask _ => count | 792 | DTask _ => count |
793 | DPolicy _ => count | 793 | DPolicy _ => count |
794 | DOnError _ => count) 0 (#1 f) | 794 | DOnError _ => count) 0 (#decls f) |
795 | 795 |
796 fun appLoc f (fl : file) = | 796 fun appLoc f (fl : file) = |
797 let | 797 let |
798 val eal = Exp.appLoc f | 798 val eal = Exp.appLoc f |
799 | 799 |
820 | PolInsert e1 => eal e1 | 820 | PolInsert e1 => eal e1 |
821 | PolDelete e1 => eal e1 | 821 | PolDelete e1 => eal e1 |
822 | PolUpdate e1 => eal e1 | 822 | PolUpdate e1 => eal e1 |
823 | PolSequence e1 => eal e1 | 823 | PolSequence e1 => eal e1 |
824 in | 824 in |
825 app appl (#1 fl) | 825 app appl (#decls fl) |
826 end | 826 end |
827 | 827 |
828 end | 828 end |
829 | 829 |
830 end | 830 end |