Commit c5fb9516 authored by mb0's avatar mb0

Clarify license issues.

parent 2655485c
Public Domain. All warranties are disclaimed.
The SPEC grammar and all code not otherwise declared is hereby submitted to
the Public Domain. All warranties are disclaimed.
The codebase includes code from several resources:
## MLTON
See MLton-LICENSE for details.
## SMLNJ
See NJ-LICENSE for details.
## MANTICORE
TODO!
This is the license for MLton, a whole-program optimizing compiler for
the Standard ML programming language. Send comments and questions to
MLton@mlton.org.
MLton COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
Copyright (C) 1999-2010 Henry Cejtin, Matthew Fluet, Suresh
Jagannathan, and Stephen Weeks.
Copyright (C) 1997-2000 by the NEC Research Institute
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice and warranty
disclaimer appear in supporting documentation, and that the name of
the above copyright holders, or their entities, not be used in
advertising or publicity pertaining to distribution of the software
without specific, written prior permission.
The above copyright holders disclaim all warranties with regard to
this software, including all implied warranties of merchantability and
fitness. In no event shall the above copyright holders be liable for
any special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether in an
action of contract, negligence or other tortious action, arising out
of or in connection with the use or performance of this software.
STANDARD ML OF NEW JERSEY COPYRIGHT NOTICE, LICENSE AND DISCLAIMER.
Copyright (c) 1989-1998 by Lucent Technologies
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both the copyright notice and this permission notice and warranty
disclaimer appear in supporting documentation, and that the name of
Lucent Technologies, Bell Labs or any Lucent entity not be used in
advertising or publicity pertaining to distribution of the software
without specific, written prior permission.
Lucent disclaims all warranties with regard to this software,
including all implied warranties of merchantability and fitness. In no
event shall Lucent be liable for any special, indirect or
consequential damages or any damages whatsoever resulting from loss of
use, data or profits, whether in an action of contract, negligence or
other tortious action, arising out of or in connection with the use
or performance of this software.
(* Changes by Tom 7 in 2003- *)
(* Copyright (C) 1999-2002 Henry Cejtin, Matthew Fluet, Suresh
(* Copyright (C) 2009 Matthew Fluet.
* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
*
* MLton is released under the GNU General Public License (GPL).
* Please see the file MLton-LICENSE for license information.
* MLton is released under a BSD-style license.
* See the file MLton-LICENSE for details.
*)
signature LAYOUT =
sig
type layout
(* layout the objects on separate lines*)
val align: layout list -> layout
val alignPrefix: layout list * string -> layout
......@@ -32,7 +32,7 @@ signature LAYOUT =
val list: layout list -> layout
(* give open, close, sep *)
val listex : string -> string -> string -> layout list -> layout
(* (* what is this? *)
val makeOutput: ('a -> layout) -> 'a * Outstream0.t -> unit
......@@ -54,7 +54,7 @@ signature LAYOUT =
val separate: layout list * string -> layout list
(* adds string at beginning of all objects except first *)
val separateLeft: layout list * string -> layout list
(* adds string at the end of all objects except last *)
(* adds string at the end of all objects except last *)
val separateRight: layout list * string -> layout list
(* layout the objects on the same line *)
val seq: layout list -> layout
......@@ -66,17 +66,17 @@ signature LAYOUT =
val tostringex : int -> layout -> string
val tuple: layout list -> layout
val tuple2: ('a -> layout) * ('b -> layout) -> 'a * 'b -> layout
val tuple3: ('a -> layout) *
('b -> layout) *
val tuple3: ('a -> layout) *
('b -> layout) *
('c -> layout) -> 'a * 'b * 'c -> layout
val tuple4: ('a -> layout) *
('b -> layout) *
('c -> layout) *
val tuple4: ('a -> layout) *
('b -> layout) *
('c -> layout) *
('d -> layout) -> 'a * 'b * 'c * 'd -> layout
val tuple5: ('a -> layout) *
('b -> layout) *
('c -> layout) *
('d -> layout) *
val tuple5: ('a -> layout) *
('b -> layout) *
('c -> layout) *
('d -> layout) *
('e -> layout) -> ('a * 'b * 'c * 'd * 'e) -> layout
val vector: layout vector -> layout
end
(* Copyright (C) 1999-2002 Henry Cejtin, Matthew Fluet, Suresh
(* Copyright (C) 2009 Matthew Fluet.
* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks.
*
* MLton is released under the GNU General Public License (GPL).
* Please see the file MLton-LICENSE for license information.
* MLton is released under a BSD-style license.
* See the file MLton-LICENSE for details.
*)
structure Layout :> LAYOUT =
struct
......@@ -10,10 +11,10 @@ struct
(* structure Out = Outstream0 *)
val detailed = ref false
fun switch {detailed = d,normal = n} x =
if !detailed then d x else n x
datatype t = T of {length: int,
tree: tree}
and tree =
......@@ -26,19 +27,19 @@ struct
type layout = t
fun length (T {length, ...}) = length
val empty = T {length = 0, tree = Empty}
fun isEmpty (T {length = 0, ...}) = true
| isEmpty _ = false
fun str s =
case s of
"" => empty
| _ => T {length = String.size s, tree = String s}
fun fold (l, b, f) = foldl f b l
fun seq ts =
let val len = fold (ts, 0, fn (t,n) => n + length t)
in case len of
......@@ -50,9 +51,9 @@ struct
short elements displays as
[1, 2, 3
4, 5, 6]
instead of
[1,
2,
3,
......@@ -83,15 +84,15 @@ struct
end
fun indent (t, n) = T {length = length t, tree = Indent (t, n)}
val tabSize: int = 8
fun K x _ = x
fun blanks (n: int): string =
concat [CharVector.tabulate (n div tabSize, K #"\t"),
CharVector.tabulate (n mod tabSize, K #" ")]
(*
fun outputTree (t, out) =
let val print = Out.outputc out
......@@ -115,7 +116,7 @@ struct
; print ")")
in loop t
end
*)
*)
(* doesn't include newlines. new version below - tom *)
......@@ -137,14 +138,14 @@ struct
in
String.concat (rev (loop (t, [])))
end
*)
*)
fun layout_print {tree: t,
print: string -> unit,
lineWidth: int} =
let
(*val _ = outputTree (t, out)*)
fun newline () = print "\n"
fun outputCompact (t, {at, printAt}) =
let
fun loop (T {tree, ...}) =
......@@ -162,7 +163,7 @@ struct
in loop t
; {at = at, printAt = at}
end
fun loop (t as T {length, tree}, state as {at, printAt}) =
let
fun prePrint () =
......@@ -226,12 +227,12 @@ struct
(*
fun outputl (t, out) = (output (t, out); Out.newline out)
*)
*)
(* fun makeOutput layoutX (x, out) = output (layoutX x, out)
*)
*)
fun ignore _ = empty
fun separate (ts, s) =
case ts of
[] => []
......@@ -240,13 +241,13 @@ struct
| loop (t :: ts) = s :: t:: (loop ts)
in loop ts
end)
fun separateLeft (ts, s) =
case ts of
[] => []
| [t] => ts
| t :: ts => t :: (map (fn t => seq [str s, t]) ts)
fun separateRight (ts, s) =
rev (let val ts = rev ts
in case ts of
......@@ -254,14 +255,14 @@ struct
| [t] => ts
| t :: ts => t :: (map (fn t => seq [t, str s]) ts)
end)
fun alignPrefix (ts, prefix) =
case ts of
[] => empty
| t :: ts =>
mayAlign [t, indent (mayAlign (map (fn t => seq [str prefix, t]) ts),
~ (String.size prefix))]
local
fun sequence (start, finish, sep) ts =
seq [str start, mayAlign (separateRight (ts, sep)), str finish]
......@@ -285,9 +286,9 @@ struct
fun array x = list (Array.foldr (op ::) [] x)
fun namedRecord (name, fields) = seq [str name, str " ", record fields]
fun paren t = seq [str "(", t, str ")"]
fun tuple2 (l1, l2) (x1, x2) = tuple [l1 x1, l2 x2]
fun tuple3 (l1, l2, l3) (x1, x2, x3) = tuple [l1 x1, l2 x2, l3 x3]
fun tuple4 (l1, l2, l3, l4) (x1, x2, x3, x4) = tuple [l1 x1, l2 x2, l3 x3, l4 x4]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment