From bc483a027ed300ffd18f66ec8487841e32c7c57d Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 17 Feb 2014 20:49:02 -0800 Subject: [PATCH] improvements --- hyphenate/hx.rkt | 56 --------------------------------------------- hyphenate/main.rkt | 41 ++++++++++++++++++++++----------- hyphenate/tests.rkt | 1 + 3 files changed, 29 insertions(+), 69 deletions(-) delete mode 100644 hyphenate/hx.rkt diff --git a/hyphenate/hx.rkt b/hyphenate/hx.rkt deleted file mode 100644 index e0fc36fa..00000000 --- a/hyphenate/hx.rkt +++ /dev/null @@ -1,56 +0,0 @@ -#lang racket/base -(require "main.rkt") -(require xml) -(require tagged-xexpr) - - -#| -The following grammar describes expressions that create X-expressions: - - xexpr = string - | (list symbol (list (list symbol string) ...) xexpr ...) - | (cons symbol (list xexpr ...)) - | symbol - | valid-char? - | cdata - | misc - -|# - - -;; recursively hyphenate strings within xexpr -;; todo: add exclusion #:only [only-proc (λ(x) x)] -(define (hx x) - (cond - [(string? x) (hyphenate x)] - [(tagged-xexpr? x) x] - ;; - ;; - [else x] ;; catches symbols, valid-chars, and cdata - ) - - ) - - -#| - (define exclusions '(style script)) ; omit these from ever being hyphenated - - -(cond - ; todo: the only-proc semantics are illogical. - ; main issue: keep it out of tags like