Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/common/error.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/common/error.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3416, Thu Nov 12 21:24:10 2015 UTC revision 3417, Thu Nov 12 23:41:06 2015 UTC
# Line 147  Line 147 
147    
148    (* sort a list of errors by position in the source file *)    (* sort a list of errors by position in the source file *)
149      val sort = let      val sort = let
150            fun lt (NONE, NONE) = false            fun gt (NONE, NONE) = false
151              | lt (NONE, _) = true              | gt (NONE, _) = true
152              | lt (_, NONE) = false              | gt (_, NONE) = false
153              | lt (SOME(l1, r1), SOME(l2, r2)) = (case Position.compare(l1, l2)              | gt (SOME(l1, r1), SOME(l2, r2)) = (case Position.compare(l1, l2)
154                   of LESS => true                   of LESS => false
155                    | EQUAL => (Position.compare(r1, r2) = LESS)                    | EQUAL => (Position.compare(r1, r2) = GREATER)
156                    | GREATER => false                    | GREATER => true
157                  (* end case *))                  (* end case *))
158            fun cmp (e1 : error, e2 : error) = lt(#pos e1, #pos e2)            fun cmp (e1 : error, e2 : error) = gt(#pos e1, #pos e2)
159            in            in
160              ListMergeSort.sort cmp              ListMergeSort.sort cmp
161            end            end

Legend:
Removed from v.3416  
changed lines
  Added in v.3417

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0