From dac62e84b324d2187ec9b9882efa47125d5599a4 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 30 Jul 2006 15:50:33 +0000 Subject: [PATCH] Fix indentation in GPL headers --- src/ast.sml | 2 +- src/baseTypes.sig | 2 +- src/baseTypes.sml | 2 +- src/dataStructures.sml | 2 +- src/domain.sig | 7 ++++++- src/domain.sml | 30 +++++++++++++++++++++++++++++- src/domtool.grm | 2 +- src/domtool.lex | 2 +- src/env.sig | 2 +- src/env.sml | 2 +- src/eval.sig | 2 +- src/eval.sml | 2 +- src/main.sig | 2 +- src/main.sml | 2 +- src/parse.sig | 2 +- src/parse.sml | 2 +- src/print.sig | 2 +- src/print.sml | 2 +- src/reduce.sig | 2 +- src/reduce.sml | 2 +- src/tycheck.sig | 2 +- src/tycheck.sml | 2 +- 22 files changed, 55 insertions(+), 22 deletions(-) diff --git a/src/ast.sml b/src/ast.sml index bd87121..efc2fb0 100644 --- a/src/ast.sml +++ b/src/ast.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Configuration language abstract syntax *) diff --git a/src/baseTypes.sig b/src/baseTypes.sig index ea7bef4..2392fd4 100644 --- a/src/baseTypes.sig +++ b/src/baseTypes.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Add some base types *) diff --git a/src/baseTypes.sml b/src/baseTypes.sml index c9e95ee..bccbe67 100644 --- a/src/baseTypes.sml +++ b/src/baseTypes.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Add some base types *) diff --git a/src/dataStructures.sml b/src/dataStructures.sml index 75531fa..27505fa 100644 --- a/src/dataStructures.sml +++ b/src/dataStructures.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Some useful data structures *) diff --git a/src/domain.sig b/src/domain.sig index 0d74a54..eb94f3f 100644 --- a/src/domain.sig +++ b/src/domain.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domain-related primitive actions *) @@ -25,4 +25,9 @@ signature DOMAIN = sig (* Register handlers to run just before and after entering a domain * block. *) + val currentDomain : unit -> string + + val domainFile : string -> TextIO.outstream + (* Open one of the current domain's configuration files. *) + end diff --git a/src/domain.sml b/src/domain.sml index e38ea4a..32b7ecf 100644 --- a/src/domain.sml +++ b/src/domain.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domain-related primitive actions *) @@ -40,9 +40,37 @@ fun registerAfter f = end val current = ref "" +val currentPath = ref "" + +fun currentDomain () = !current + +fun domainFile name = TextIO.openOut (!currentPath ^ name) + +fun getPath domain = + let + val toks = String.fields (fn ch => ch = #".") domain + + val elems = foldr (fn (piece, elems) => + let + val elems = piece :: elems + val path = String.concatWith "/" (Config.configRoot :: rev elems) + in + (if Posix.FileSys.ST.isDir + (Posix.FileSys.stat path) then + () + else + (OS.FileSys.remove path; + OS.FileSys.mkDir path)) + handle OS.SysErr _ => OS.FileSys.mkDir path; + elems + end) [] toks + in + String.concatWith "/" (Config.configRoot :: rev elems) + end val _ = Env.registerContainer ("domain", fn (_, [(EString dom, _)]) => (current := dom; + currentPath := getPath dom; !befores dom; StringMap.empty) | _ => Env.badArgs "domain", diff --git a/src/domtool.grm b/src/domtool.grm index 349ab7a..cd899e1 100644 --- a/src/domtool.grm +++ b/src/domtool.grm @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Parser for Domtool configuration files *) diff --git a/src/domtool.lex b/src/domtool.lex index 6bf3475..5e40aa2 100644 --- a/src/domtool.lex +++ b/src/domtool.lex @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Lexer for Domtool configuration files *) diff --git a/src/env.sig b/src/env.sig index f965ee2..d239e14 100644 --- a/src/env.sig +++ b/src/env.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domtool type-checking and reduction environments *) diff --git a/src/env.sml b/src/env.sml index 47003cb..2141f64 100644 --- a/src/env.sml +++ b/src/env.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domtool type-checking and reduction environments *) diff --git a/src/eval.sig b/src/eval.sig index 9b98e67..e9cd6aa 100644 --- a/src/eval.sig +++ b/src/eval.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Execution of Domtool programs reduced to primitive actions *) diff --git a/src/eval.sml b/src/eval.sml index c05d781..37a5d63 100644 --- a/src/eval.sml +++ b/src/eval.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Execution of Domtool programs reduced to primitive actions *) diff --git a/src/main.sig b/src/main.sig index f36fb65..46aedfb 100644 --- a/src/main.sig +++ b/src/main.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Main interface *) diff --git a/src/main.sml b/src/main.sml index 7bc4599..7740522 100644 --- a/src/main.sml +++ b/src/main.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Main interface *) diff --git a/src/parse.sig b/src/parse.sig index fa65151..7d06f47 100644 --- a/src/parse.sig +++ b/src/parse.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domtool configuration language parser *) diff --git a/src/parse.sml b/src/parse.sml index 5a5ce3f..d8dc9b9 100644 --- a/src/parse.sml +++ b/src/parse.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domtool configuration language parser *) diff --git a/src/print.sig b/src/print.sig index 8ac5294..6d615e6 100644 --- a/src/print.sig +++ b/src/print.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Pretty-printing Domtool configuration file ASTs *) diff --git a/src/print.sml b/src/print.sml index 4b497bd..9305714 100644 --- a/src/print.sml +++ b/src/print.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Pretty-printing Domtool configuration file ASTs *) diff --git a/src/reduce.sig b/src/reduce.sig index a874362..1aa6a8a 100644 --- a/src/reduce.sig +++ b/src/reduce.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Evaluation of expressions until only externs are around *) diff --git a/src/reduce.sml b/src/reduce.sml index 17a8507..5913873 100644 --- a/src/reduce.sml +++ b/src/reduce.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Evaluation of expressions until only externs are around *) diff --git a/src/tycheck.sig b/src/tycheck.sig index 50a816f..6ef31a5 100644 --- a/src/tycheck.sig +++ b/src/tycheck.sig @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domtool configuration language type checking *) diff --git a/src/tycheck.sml b/src/tycheck.sml index 30a1d86..8d35e2d 100644 --- a/src/tycheck.sml +++ b/src/tycheck.sml @@ -14,7 +14,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*) + *) (* Domtool configuration language type checking *) -- 2.20.1