Mercurial > urweb
comparison src/demo.sml @ 1151:de48dc2c9ee8
Allow .urp files without initial blank lines
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sat, 06 Feb 2010 15:34:41 -0500 |
parents | d069b193ed6b |
children | b6111b688060 |
comparison
equal
deleted
inserted
replaced
1150:151837581b5e | 1151:de48dc2c9ee8 |
---|---|
1 (* Copyright (c) 2008, Adam Chlipala | 1 (* Copyright (c) 2008-2010, Adam Chlipala |
2 * All rights reserved. | 2 * All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
195 let | 195 let |
196 val src = OS.Path.joinBaseExt {base = file, | 196 val src = OS.Path.joinBaseExt {base = file, |
197 ext = SOME s} | 197 ext = SOME s} |
198 val src' = OS.Path.file src | 198 val src' = OS.Path.file src |
199 in | 199 in |
200 if String.isPrefix (OS.Path.mkCanonical dirname) src | 200 if String.isPrefix (OS.Path.mkAbsolute {path = dirname, |
201 relativeTo = OS.FileSys.getDir ()}) src | |
201 andalso OS.FileSys.access (src, []) then | 202 andalso OS.FileSys.access (src, []) then |
202 (TextIO.output (out, " | <a target=\"showcase\" href=\""); | 203 (TextIO.output (out, " | <a target=\"showcase\" href=\""); |
203 TextIO.output (out, src'); | 204 TextIO.output (out, src'); |
204 TextIO.output (out, ".html\"><tt>"); | 205 TextIO.output (out, ".html\"><tt>"); |
205 TextIO.output (out, src'); | 206 TextIO.output (out, src'); |
206 TextIO.output (out, "</tt></a>")) | 207 TextIO.output (out, "</tt></a>")) |
207 else | 208 else |
208 () | 209 print (src ^ " " |
210 ^ OS.Path.mkAbsolute {path = dirname, | |
211 relativeTo = OS.FileSys.getDir ()} ^ "\n") | |
209 end | 212 end |
210 in | 213 in |
211 ifEx "urs"; | 214 ifEx "urs"; |
212 ifEx "ur" | 215 ifEx "ur" |
213 end) (#sources urpData); | 216 end) (#sources urpData); |