Skip to content
Newer
Older
100644 36 lines (28 sloc) 1.14 KB
fccc685 Initial open-source release
MLstate authored Jun 21, 2011
1 (*
2 Copyright © 2011 MLstate
3
4 This file is part of OPA.
5
6 OPA is free software: you can redistribute it and/or modify it under the
7 terms of the GNU Affero General Public License, version 3, as published by
8 the Free Software Foundation.
9
10 OPA is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
13 more details.
14
15 You should have received a copy of the GNU Affero General Public License
16 along with OPA. If not, see <http://www.gnu.org/licenses/>.
17 *)
18 type expr =
19 | SetDistant of JsIdent.t list
20 | TaggedString of string * QmlAst.tagged_string_kind
21
22
23 module List = BaseList
24 let compare_tagged_string_kind = Pervasives.compare
25
26 let compare e1 e2 =
27 match e1, e2 with
28 | SetDistant l1, SetDistant l2 ->
29 List.make_compare JsIdent.compare l1 l2
30 | SetDistant _, _ -> -1
31 | _, SetDistant _ -> 1
32 | TaggedString (s1, kind1), TaggedString (s2, kind2) ->
33 (match String.compare s1 s2 with
34 | 0 -> compare_tagged_string_kind kind1 kind2
35 | c -> c)
Something went wrong with that request. Please try again.