summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-02-07 09:38:27 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-02-07 09:38:27 -0500
commit2b0eaeecac17ab4bd6995a6a0eb504c58d48b776 (patch)
tree6b5002384a4f6f6a6ad3ef8e23760fc24e23c244 /src/compiler.sml
parent32bf355546ebc775fd0a80ca24d06259d111f496 (diff)
Fix detection of blank lines in .urp
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index ab3ec10a..cba385e2 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -286,19 +286,12 @@ fun parseUrp' accLibs fname =
val inf = opener ()
- fun hasAnyLine () =
+ fun hasSpaceLine () =
case TextIO.inputLine inf of
NONE => false
- | SOME "\n" => false
- | _ => true
+ | SOME s => CharVector.exists Char.isSpace s orelse hasSpaceLine ()
- fun hasBlankLine () =
- case TextIO.inputLine inf of
- NONE => false
- | SOME "\n" => hasAnyLine ()
- | _ => hasBlankLine ()
-
- val hasBlankLine = hasBlankLine ()
+ val hasBlankLine = hasSpaceLine ()
val inf = (TextIO.closeIn inf; opener ())