(* styles/cm.sml -- meshes with CM output; highlighted in sml-mode * Copyright ©2007 Christopher League * * This library is free software; you may redistribute and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; see the file COPYING. *) structure CMStyle = struct val name = "CM" infix << fun os << f = f os fun s str os = os before TextIO.output(os, str) val i = s o Int.toString fun pad wd = s o StringCvt.padLeft #"0" wd o Int.toString fun return x _ = x fun new tag = let val os = TextIO.stdOut val _ = os < os < (case Settings.get Settings.gen_target of NONE => os < (if n >= goal then os < let val wd = size(Int.toString(length es)) fun each (NONE,i) = i+1 | each (SOME e,i) = os <