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- *) (* Changes by Tom 7 in 2003- *)
(* Copyright (C) 2009 Matthew Fluet.
(* Copyright (C) 1999-2002 Henry Cejtin, Matthew Fluet, Suresh * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
* Jagannathan, and Stephen Weeks. * Jagannathan, and Stephen Weeks.
* *
* MLton is released under the GNU General Public License (GPL). * MLton is released under a BSD-style license.
* Please see the file MLton-LICENSE for license information. * See the file MLton-LICENSE for details.
*) *)
signature LAYOUT = signature LAYOUT =
sig sig
type layout type layout
(* layout the objects on separate lines*) (* layout the objects on separate lines*)
val align: layout list -> layout val align: layout list -> layout
val alignPrefix: layout list * string -> layout val alignPrefix: layout list * string -> layout
...@@ -32,7 +32,7 @@ signature LAYOUT = ...@@ -32,7 +32,7 @@ signature LAYOUT =
val list: layout list -> layout val list: layout list -> layout
(* give open, close, sep *) (* give open, close, sep *)
val listex : string -> string -> string -> layout list -> layout val listex : string -> string -> string -> layout list -> layout
(* (* what is this? *) (* (* what is this? *)
val makeOutput: ('a -> layout) -> 'a * Outstream0.t -> unit val makeOutput: ('a -> layout) -> 'a * Outstream0.t -> unit
...@@ -54,7 +54,7 @@ signature LAYOUT = ...@@ -54,7 +54,7 @@ signature LAYOUT =
val separate: layout list * string -> layout list val separate: layout list * string -> layout list
(* adds string at beginning of all objects except first *) (* adds string at beginning of all objects except first *)
val separateLeft: layout list * string -> layout list 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 val separateRight: layout list * string -> layout list
(* layout the objects on the same line *) (* layout the objects on the same line *)
val seq: layout list -> layout val seq: layout list -> layout
...@@ -66,17 +66,17 @@ signature LAYOUT = ...@@ -66,17 +66,17 @@ signature LAYOUT =
val tostringex : int -> layout -> string val tostringex : int -> layout -> string
val tuple: layout list -> layout val tuple: layout list -> layout
val tuple2: ('a -> layout) * ('b -> layout) -> 'a * 'b -> layout val tuple2: ('a -> layout) * ('b -> layout) -> 'a * 'b -> layout
val tuple3: ('a -> layout) * val tuple3: ('a -> layout) *
('b -> layout) * ('b -> layout) *
('c -> layout) -> 'a * 'b * 'c -> layout ('c -> layout) -> 'a * 'b * 'c -> layout
val tuple4: ('a -> layout) * val tuple4: ('a -> layout) *
('b -> layout) * ('b -> layout) *
('c -> layout) * ('c -> layout) *
('d -> layout) -> 'a * 'b * 'c * 'd -> layout ('d -> layout) -> 'a * 'b * 'c * 'd -> layout
val tuple5: ('a -> layout) * val tuple5: ('a -> layout) *
('b -> layout) * ('b -> layout) *
('c -> layout) * ('c -> layout) *
('d -> layout) * ('d -> layout) *
('e -> layout) -> ('a * 'b * 'c * 'd * 'e) -> layout ('e -> layout) -> ('a * 'b * 'c * 'd * 'e) -> layout
val vector: layout vector -> layout val vector: layout vector -> layout
end 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. * Jagannathan, and Stephen Weeks.
* *
* MLton is released under the GNU General Public License (GPL). * MLton is released under a BSD-style license.
* Please see the file MLton-LICENSE for license information. * See the file MLton-LICENSE for details.
*) *)
structure Layout :> LAYOUT = structure Layout :> LAYOUT =
struct struct
...@@ -10,10 +11,10 @@ struct ...@@ -10,10 +11,10 @@ struct
(* structure Out = Outstream0 *) (* structure Out = Outstream0 *)
val detailed = ref false val detailed = ref false
fun switch {detailed = d,normal = n} x = fun switch {detailed = d,normal = n} x =
if !detailed then d x else n x if !detailed then d x else n x
datatype t = T of {length: int, datatype t = T of {length: int,
tree: tree} tree: tree}
and tree = and tree =
...@@ -26,19 +27,19 @@ struct ...@@ -26,19 +27,19 @@ struct
type layout = t type layout = t
fun length (T {length, ...}) = length fun length (T {length, ...}) = length
val empty = T {length = 0, tree = Empty} val empty = T {length = 0, tree = Empty}
fun isEmpty (T {length = 0, ...}) = true fun isEmpty (T {length = 0, ...}) = true
| isEmpty _ = false | isEmpty _ = false
fun str s = fun str s =
case s of case s of
"" => empty "" => empty
| _ => T {length = String.size s, tree = String s} | _ => T {length = String.size s, tree = String s}
fun fold (l, b, f) = foldl f b l fun fold (l, b, f) = foldl f b l
fun seq ts = fun seq ts =
let val len = fold (ts, 0, fn (t,n) => n + length t) let val len = fold (ts, 0, fn (t,n) => n + length t)
in case len of in case len of
...@@ -50,9 +51,9 @@ struct ...@@ -50,9 +51,9 @@ struct
short elements displays as short elements displays as
[1, 2, 3 [1, 2, 3
4, 5, 6] 4, 5, 6]
instead of instead of
[1, [1,
2, 2,
3, 3,
...@@ -83,15 +84,15 @@ struct ...@@ -83,15 +84,15 @@ struct
end end
fun indent (t, n) = T {length = length t, tree = Indent (t, n)} fun indent (t, n) = T {length = length t, tree = Indent (t, n)}
val tabSize: int = 8 val tabSize: int = 8
fun K x _ = x fun K x _ = x
fun blanks (n: int): string = fun blanks (n: int): string =
concat [CharVector.tabulate (n div tabSize, K #"\t"), concat [CharVector.tabulate (n div tabSize, K #"\t"),
CharVector.tabulate (n mod tabSize, K #" ")] CharVector.tabulate (n mod tabSize, K #" ")]
(* (*
fun outputTree (t, out) = fun outputTree (t, out) =
let val print = Out.outputc out let val print = Out.outputc out
...@@ -115,7 +116,7 @@ struct ...@@ -115,7 +116,7 @@ struct
; print ")") ; print ")")
in loop t in loop t
end end
*) *)
(* doesn't include newlines. new version below - tom *) (* doesn't include newlines. new version below - tom *)
...@@ -137,14 +138,14 @@ struct ...@@ -137,14 +138,14 @@ struct
in in
String.concat (rev (loop (t, []))) String.concat (rev (loop (t, [])))
end end
*) *)
fun layout_print {tree: t, fun layout_print {tree: t,
print: string -> unit, print: string -> unit,
lineWidth: int} = lineWidth: int} =
let let
(*val _ = outputTree (t, out)*) (*val _ = outputTree (t, out)*)
fun newline () = print "\n" fun newline () = print "\n"
fun outputCompact (t, {at, printAt}) = fun outputCompact (t, {at, printAt}) =
let let
fun loop (T {tree, ...}) = fun loop (T {tree, ...}) =
...@@ -162,7 +163,7 @@ struct ...@@ -162,7 +163,7 @@ struct
in loop t in loop t
; {at = at, printAt = at} ; {at = at, printAt = at}
end end
fun loop (t as T {length, tree}, state as {at, printAt}) = fun loop (t as T {length, tree}, state as {at, printAt}) =
let let
fun prePrint () = fun prePrint () =
...@@ -226,12 +227,12 @@ struct ...@@ -226,12 +227,12 @@ struct
(* (*
fun outputl (t, out) = (output (t, out); Out.newline out) fun outputl (t, out) = (output (t, out); Out.newline out)
*) *)
(* fun makeOutput layoutX (x, out) = output (layoutX x, out) (* fun makeOutput layoutX (x, out) = output (layoutX x, out)
*) *)
fun ignore _ = empty fun ignore _ = empty
fun separate (ts, s) = fun separate (ts, s) =
case ts of case ts of
[] => [] [] => []
...@@ -240,13 +241,13 @@ struct ...@@ -240,13 +241,13 @@ struct
| loop (t :: ts) = s :: t:: (loop ts) | loop (t :: ts) = s :: t:: (loop ts)
in loop ts in loop ts
end) end)
fun separateLeft (ts, s) = fun separateLeft (ts, s) =
case ts of case ts of
[] => [] [] => []
| [t] => ts | [t] => ts
| t :: ts => t :: (map (fn t => seq [str s, t]) ts) | t :: ts => t :: (map (fn t => seq [str s, t]) ts)
fun separateRight (ts, s) = fun separateRight (ts, s) =
rev (let val ts = rev ts rev (let val ts = rev ts
in case ts of in case ts of
...@@ -254,14 +255,14 @@ struct ...@@ -254,14 +255,14 @@ struct
| [t] => ts | [t] => ts
| t :: ts => t :: (map (fn t => seq [t, str s]) ts) | t :: ts => t :: (map (fn t => seq [t, str s]) ts)
end) end)
fun alignPrefix (ts, prefix) = fun alignPrefix (ts, prefix) =
case ts of case ts of
[] => empty [] => empty
| t :: ts => | t :: ts =>
mayAlign [t, indent (mayAlign (map (fn t => seq [str prefix, t]) ts), mayAlign [t, indent (mayAlign (map (fn t => seq [str prefix, t]) ts),
~ (String.size prefix))] ~ (String.size prefix))]
local local
fun sequence (start, finish, sep) ts = fun sequence (start, finish, sep) ts =
seq [str start, mayAlign (separateRight (ts, sep)), str finish] seq [str start, mayAlign (separateRight (ts, sep)), str finish]
...@@ -285,9 +286,9 @@ struct ...@@ -285,9 +286,9 @@ struct
fun array x = list (Array.foldr (op ::) [] x) fun array x = list (Array.foldr (op ::) [] x)
fun namedRecord (name, fields) = seq [str name, str " ", record fields] fun namedRecord (name, fields) = seq [str name, str " ", record fields]
fun paren t = seq [str "(", t, str ")"] fun paren t = seq [str "(", t, str ")"]
fun tuple2 (l1, l2) (x1, x2) = tuple [l1 x1, l2 x2] 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 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] 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