36 |
{ linewidth = !P.linewidth, flush = P.flush, consumer = P.say } |
{ linewidth = !P.linewidth, flush = P.flush, consumer = P.say } |
37 |
val source = S.newSource (filename, 1, stream, false, errcons) |
val source = S.newSource (filename, 1, stream, false, errcons) |
38 |
val sourceMap = #sourceMap source |
val sourceMap = #sourceMap source |
39 |
fun error region m = |
fun error' region m b = EM.error source region EM.COMPLAIN m b |
40 |
EM.error source region EM.COMPLAIN m EM.nullErrorBody |
fun error region m = error' region m EM.nullErrorBody |
41 |
|
|
42 |
(* recParse returns a group (not an option) |
(* recParse returns a group (not an option) |
43 |
* and re-raises LrParser.ParseError. |
* and re-raises LrParser.ParseError. |
50 |
| SOME res => res |
| SOME res => res |
51 |
|
|
52 |
fun doMember (p, p1, p2, c, e) = |
fun doMember (p, p1, p2, c, e) = |
53 |
CMSemant.member (recParse (p1, p2)) { sourcepath = p, |
CMSemant.member (recParse (p1, p2)) |
54 |
|
{ sourcepath = p, |
55 |
group = group, |
group = group, |
56 |
class = c, |
class = c, |
57 |
error = e } |
error = e } |
153 |
val (parseResult, _) = |
val (parseResult, _) = |
154 |
CMParse.parse (lookAhead, tokenStream, |
CMParse.parse (lookAhead, tokenStream, |
155 |
fn (s,p1,p2) => error (p1, p2) s, |
fn (s,p1,p2) => error (p1, p2) s, |
156 |
(context, error, recParse, doMember)) |
(context, error', error, recParse, doMember)) |
157 |
in |
in |
158 |
TextIO.closeIn stream; |
TextIO.closeIn stream; |
159 |
if !(#anyErrors source) then NONE |
if !(#anyErrors source) then NONE |