0 | module Text.WebIDL.Parser
 1 |
 2 | import public Text.WebIDL.Parser.Arguments
 3 | import public Text.WebIDL.Parser.Attributes
 4 | import public Text.WebIDL.Parser.Definitions
 5 | import public Text.WebIDL.Parser.Members
 6 | import public Text.WebIDL.Parser.Type
 7 | import public Text.WebIDL.Parser.Util
 8 |
 9 | --------------------------------------------------------------------------------
10 | --          Parsing WebIDL
11 | --------------------------------------------------------------------------------
12 |
13 | export
14 | parseIdl : Rule b a -> String -> Either (Bounded ParseErr) a
15 | parseIdl g s =
16 |   let Right ts := lexIdl s | Left err => Left err
17 |       Succ0 v [] := g ts
18 |         | Succ0 v (x::xs) => unexpected x
19 |         | Fail0 err       => Left err
20 |    in Right v
21 |