summaryrefslogtreecommitdiff
path: root/src
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
commit10b8344731e3ba5158321372716c405f3363695f (patch)
tree6b5002384a4f6f6a6ad3ef8e23760fc24e23c244 /src
parent94ef8c3721548c3125fff96c8426921936287a7e (diff)
Fix detection of blank lines in .urp
Diffstat (limited to 'src')
-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 ())