Skip to content

Commit 30193e4

Browse files
authored
Merge pull request #690 from CakeML/close-files
Fix too many open files error
2 parents f83143b + 7841105 commit 30193e4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

compiler/parsing/tests/cmlTestsScript.sml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ Overload EREL =
1919
[NN nElogicOR
2020
[NN nElogicAND
2121
[NN nEtyped [NN nEbefore [NN nEcomp l]]]]]]``
22-
Overaload EB =
23-
``λl. EREL [NN nErel [NN nElistop [NN nEadd [NN nEmult [NN nEapp [NN nEbase l]]]]]]``
22+
Overload EB = ``λl. EREL [NN nErel [NN nElistop [NN nEadd [NN nEmult [NN nEapp [NN nEbase l]]]]]]``
2423

2524
Overload OLDAPP = ``λt1 t2. App Opapp [t1; t2]``
26-
Overload "" = ``λt1 t2. App Opapp [t1; t2]``
25+
(* Overload "" = ``λt1 t2. App Opapp [t1; t2]`` *)
2726
Overload vbinop = ``λopn a1 a2. App Opapp [App Opapp [Var opn; a1]; a2]``
2827
Overload V = ``λvnm. Var (Short vnm)``
2928
Overload Pc = ``λcnm. Pcon (SOME (Short cnm))``

developers/readme_gen.sml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ fun read_block_comment start_comment end_comment filename = let
221221
val all_lines =
222222
map (drop_chars (String.size blank_prefix)) (fst_line :: read_rest ())
223223
val _ = check_length_and_width all_lines
224+
val _ = TextIO.closeIn(f)
224225
in all_lines end handle e => (TextIO.closeIn(f); raise e)
225226
end end;
226227

@@ -256,6 +257,7 @@ fun read_comment_from_script filename = let
256257
val all_lines =
257258
map (drop_chars (String.size prefix)) (fst_line :: read_rest ())
258259
val _ = check_length_and_width all_lines
260+
val _ = TextIO.closeIn(f)
259261
in all_lines end handle e => (TextIO.closeIn(f); raise e)
260262
end;
261263

@@ -276,6 +278,7 @@ fun read_comment_from_raw filename = let
276278
val _ = not (String.isPrefix " " (hd all_lines)) orelse
277279
fail "first line must not start with a blank"
278280
val _ = check_length_and_width all_lines
281+
val _ = TextIO.closeIn(f)
279282
in all_lines end handle e => (TextIO.closeIn(f); raise e)
280283
end;
281284

0 commit comments

Comments
 (0)