diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-06-24 18:35:48 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2011-06-24 18:35:48 +0200 |
commit | 46e931cf02951d23ab208ae92c2516764db6d914 (patch) | |
tree | 0952aacdd78a61fac8b98ceca2acf2cdf675598c | |
parent | 619cc7ed168d47f942b7d4c2190562ac6eafea8b (diff) |
Move public type declarations and definitions to the top of the file.
-rwxr-xr-x | json-template.rkt | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/json-template.rkt b/json-template.rkt index 9729159..f1a1b54 100755 --- a/json-template.rkt +++ b/json-template.rkt @@ -12,15 +12,16 @@ [dict-ref (Any Any Any -> Any)] [dict? (Any -> Boolean)]) -(provide make-template - formatters - meta-left - meta-right - default-formatter - format-char) +(provide: [make-template (String -> Template)] + [formatters (Parameterof (Listof (Pairof String (String -> String))))] + [meta-left (Parameterof String)] + [meta-right (Parameterof String)] + [default-formatter (Parameterof String)] + [format-char (Parameterof String)]) +(provide Template) -#; -(provide: ...) + +(define-type Template (Any -> Void)) (define meta-left (make-parameter "{")) (define meta-right (make-parameter "}")) @@ -209,9 +210,7 @@ ;; #:property prop:procedure (struct-field-index expander)) -(define-type template (Any -> Void)) - -(define: (make-template [input-string : String]) : template +(define (make-template input-string) (let ([template-data (parse-structure* (remove-spurious-newlines-from-token-groups @@ -363,7 +362,7 @@ (printf "%~x" cnum)))))))) -(define: formatters : (Parameterof (Listof (Pairof String (String -> String)))) +(define formatters (make-parameter `(("html" . ,(make-escaper '((#\< . "<") (#\> . ">") |