comparison src/compiler.sml @ 135:b1cfe49ce692

Proper escaping of cdata
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Jul 2008 13:33:56 -0400
parents 18299126a343
children d6d78055f001
comparison
equal deleted inserted replaced
134:18299126a343 135:b1cfe49ce692
49 val () = loop () 49 val () = loop ()
50 val () = TextIO.closeIn inf 50 val () = TextIO.closeIn inf
51 val () = TextIO.closeOut outf 51 val () = TextIO.closeOut outf
52 52
53 val () = (ErrorMsg.resetErrors (); 53 val () = (ErrorMsg.resetErrors ();
54 ErrorMsg.resetPositioning filename) 54 ErrorMsg.resetPositioning filename;
55 Lex.UserDeclarations.initialize ())
55 val file = TextIO.openIn fname 56 val file = TextIO.openIn fname
56 fun get _ = TextIO.input file 57 fun get _ = TextIO.input file
57 fun parseerror (s, p1, p2) = ErrorMsg.errorAt' (p1, p2) s 58 fun parseerror (s, p1, p2) = ErrorMsg.errorAt' (p1, p2) s
58 val lexer = LrParser.Stream.streamify (Lex.makeLexer get) 59 val lexer = LrParser.Stream.streamify (Lex.makeLexer get)
59 val (absyn, _) = LacwebP.parse (30, lexer, parseerror, ()) 60 val (absyn, _) = LacwebP.parse (30, lexer, parseerror, ())
77 78
78 (* The main parsing routine *) 79 (* The main parsing routine *)
79 fun parseLac filename = 80 fun parseLac filename =
80 let 81 let
81 val () = (ErrorMsg.resetErrors (); 82 val () = (ErrorMsg.resetErrors ();
82 ErrorMsg.resetPositioning filename) 83 ErrorMsg.resetPositioning filename;
84 Lex.UserDeclarations.initialize ())
83 val file = TextIO.openIn filename 85 val file = TextIO.openIn filename
84 fun get _ = TextIO.input file 86 fun get _ = TextIO.input file
85 fun parseerror (s, p1, p2) = ErrorMsg.errorAt' (p1, p2) s 87 fun parseerror (s, p1, p2) = ErrorMsg.errorAt' (p1, p2) s
86 val lexer = LrParser.Stream.streamify (Lex.makeLexer get) 88 val lexer = LrParser.Stream.streamify (Lex.makeLexer get)
87 val (absyn, _) = LacwebP.parse (30, lexer, parseerror, ()) 89 val (absyn, _) = LacwebP.parse (30, lexer, parseerror, ())