45 |
* This function is used to parse aliases and sub-groups. *) |
* This function is used to parse aliases and sub-groups. *) |
46 |
fun recParse (p1, p2) p = |
fun recParse (p1, p2) p = |
47 |
case parse' (p, (group, (source, p1, p2)) :: groupstack) of |
case parse' (p, (group, (source, p1, p2)) :: groupstack) of |
48 |
NONE => raise LrParser.ParseError |
NONE => (#anyErrors source := true; CMSemant.emptyGroup) |
49 |
| SOME res => res |
| SOME res => res |
50 |
|
|
51 |
fun doMember (p, p1, p2, c) = |
fun doMember (p, p1, p2, c) = |
73 |
end |
end |
74 |
in |
in |
75 |
PrettyPrint.add_newline pps; |
PrettyPrint.add_newline pps; |
76 |
PrettyPrint.begin_block pps PrettyPrint.CONSISTENT 4; |
loop (g, hist) |
|
loop (g, hist); |
|
|
PrettyPrint.end_block pps |
|
77 |
end |
end |
78 |
in |
in |
79 |
EM.error s (p1, p2) EM.COMPLAIN |
EM.error s (p1, p2) EM.COMPLAIN |
80 |
("group hierarchy forms a cycle with " ^ AbsPath.spec group) |
("group hierarchy forms a cycle with " ^ AbsPath.spec group) |
81 |
pphist |
pphist; |
82 |
|
raise LrParser.ParseError |
83 |
end |
end |
84 |
in |
in |
85 |
case findCycle (groupstack, []) of |
case findCycle (groupstack, []) of |
155 |
TextIO.closeIn stream; |
TextIO.closeIn stream; |
156 |
if !(#anyErrors source) then NONE |
if !(#anyErrors source) then NONE |
157 |
else SOME parseResult |
else SOME parseResult |
158 |
end handle LrParser.ParseError => NONE |
end |
159 |
|
handle LrParser.ParseError => NONE |
160 |
|
| Cycle => NONE |
161 |
|
|
162 |
fun parse group = parse' (group, []) |
fun parse group = parse' (group, []) |
163 |
end |
end |