diff options
author | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2014-12-18 13:52:12 +0100 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2014-12-18 13:52:12 +0100 |
commit | 04292034ef23e8cfdab593b7d248368085631881 (patch) | |
tree | 4e2d24c2ba129f68da014ea13212a25731d74b9e /tools/ndfun.ml | |
parent | c1daedb244d1f7586c12749642b0d78ae910e60a (diff) | |
parent | 3262e1e2e71b4fad5d5c47603aafb4dcb2539e27 (diff) | |
download | compcert-04292034ef23e8cfdab593b7d248368085631881.tar.gz compcert-04292034ef23e8cfdab593b7d248368085631881.zip |
Merge pull request #3 from AbsInt/pure-makefiles
Merge of the pure-makefiles branch, which uses Makefiles instead of ocamlbuild to build the Caml code.
Diffstat (limited to 'tools/ndfun.ml')
-rw-r--r-- | tools/ndfun.ml | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/tools/ndfun.ml b/tools/ndfun.ml index 78fb03d5..4ee07e54 100644 --- a/tools/ndfun.ml +++ b/tools/ndfun.ml @@ -1,3 +1,20 @@ +(* *********************************************************************) +(* *) +(* The Compcert verified compiler *) +(* *) +(* Xavier Leroy, INRIA Paris-Rocquencourt *) +(* *) +(* Copyright Institut National de Recherche en Informatique et en *) +(* Automatique. All rights reserved. This file is distributed *) +(* under the terms of the GNU General Public License as published by *) +(* the Free Software Foundation, either version 2 of the License, or *) +(* (at your option) any later version. This file is also distributed *) +(* under the terms of the INRIA Non-Commercial License Agreement. *) +(* *) +(* *********************************************************************) + +(* Preprocessor for .vp files *) + open Printf (* Error reporting *) @@ -9,11 +26,7 @@ let error file line msg = (* Replace newlines with spaces *) let oneline s = - let t = String.create (String.length s) in - for i = 0 to String.length s - 1 do - t.[i] <- (match s.[i] with '\n' -> ' ' | c -> c) - done; - t + String.map (function '\n' -> ' ' | c -> c) s (* Trim leading and terminating spaces, and compress multiple spaces *) |