module Load open Microsoft.FSharp.Text.Lexing open System.IO open System.Text open LogoRep open LogoLexer open LogoParser let load text = let lexbuf = LexBuffer<_>.FromString text try LogoParser.start LogoLexer.token lexbuf with e -> let pos = lexbuf.StartPos failwithf "Error at line %d col %d: %s" pos.Line pos.Column e.Message let load_file file = File.ReadAllText(file, Encoding.ASCII) |> load