From 2b0eaeecac17ab4bd6995a6a0eb504c58d48b776 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 7 Feb 2010 09:38:27 -0500 Subject: Fix detection of blank lines in .urp --- src/compiler.sml | 13 +++---------- 1 file 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 ()) -- cgit v1.2.3