Changeset c381bb2b7e39…
Parent 876e4bb434dc…
by Hao Lian <hao@fogcreek.com>
Changes to 2 files · Browse files at c381bb2b7e39 Showing diff from parent 876e4bb434dc Diff from another changeset...
@@ -5,11 +5,6 @@ open System
type Keyword = Word of string | Phrase of string
- with
- override this.ToString() =
- match this with
- | Word s -> String.Format("Word<{0}>", s)
- | Phrase s -> String.Format("Phrase<{0}>", s)
type Filter =
| Author of string
@@ -19,13 +14,9 @@ | Repo of string
type Atom = KeywordAtom of Keyword | FilterAtom of Filter
- with
- override this.ToString() =
- match this with
- | KeywordAtom k -> String.Format("KeywordAtom<{0}>", k)
- | FilterAtom f -> String.Format("FilterAtom<{0}>", f)
-exception ParseError of string
+type ParseError (msg: string) =
+ inherit Exception (msg)
(* Utilities *)
let pipeline (f, a) = f a
@@ -41,7 +32,7 @@ | "file" -> File
| "project" -> Project
| "repo" -> Repo
- | _ -> raise <| Exception "Invalid filter name"
+ | _ -> raise <| ParseError "Invalid filter name"
(* Parsers *)
let word = many1Satisfy <| fun c -> c <> ' '
|
Loading...