From cf46006b636a079e15425a9b42cd8c5ca30f9d3e Mon Sep 17 00:00:00 2001 From: John Williams Date: Thu, 5 Aug 2010 14:28:26 +0100 Subject: [PATCH] Applied patch from Pascal J. Bourguignon --- defpackage.lisp | 2 +- languages/translate.lisp | 2 +- parsers/rst.lisp | 12 +++++++++--- parsers/state-machine.lisp | 3 ++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/defpackage.lisp b/defpackage.lisp index de0c537..a5aa2a7 100644 --- a/defpackage.lisp +++ b/defpackage.lisp @@ -18,7 +18,7 @@ #:resolvable #:backlinkable #:root #:titular #:predecorative #:prebibliographic #:bibliographic #:decorative #:body #:general #:sequential #:abmonition #:special #:invisible #:part - #:referential #:targetable #: #:title #:subtitle #:rubric + #:referential #:targetable #:title #:subtitle #:rubric #:docinfo #:author #:authors #:organization #:address #:contact #:version #:revision #:status #:date #:copyright #:decoration #:header #:footer #:structural #:section #:topic #:sidebar diff --git a/languages/translate.lisp b/languages/translate.lisp index aab88f0..0cc4e28 100644 --- a/languages/translate.lisp +++ b/languages/translate.lisp @@ -17,7 +17,7 @@ containing an a-list mapping translated form to a cannonical form") (eval-when(:compile-toplevel) (setq *language-directory* - (merge-pathnames (make-pathname :name :wild :type :unspecific) + (merge-pathnames (make-pathname :name :wild #-clisp :type #-clisp :unspecific) *compile-file-truename*))) (defstruct translation (translated (make-hash-table :test #'equalp) :type hash-table) diff --git a/parsers/rst.lisp b/parsers/rst.lisp index 356b961..6663301 100644 --- a/parsers/rst.lisp +++ b/parsers/rst.lisp @@ -166,7 +166,7 @@ content block and a callback to parse the content block") runs, to parse nested document structures.")) (defmethod state-machine-run((state-machine nested-state-machine) - (input-lines simple-vector) + (input-lines vector) &key (input-offset 0) node @@ -303,6 +303,10 @@ back up the calling chain until the correct section level is reached." (defun inline-text(text lineno) (parse-inline rst-patterns text :line lineno )) + + +(eval-when (:compile-toplevel :load-toplevel :execute) + (defparameter +roman-numeral-map+ '(("M" . 1000) ("CM" . 900) ("D" . 500) ("CD" . 400) ("C" . 100) ("XC" . 90) ("L" . 50) ("XL" . 40) @@ -393,7 +397,7 @@ ordinal and the type value to be given in html") (anonymous "^__( +|$)") (line line) (text ,#'(lambda(s &key (start 0) (end (length s))) - (values start end)) 'body)))) + (values start end)) 'body))))) (defclass body(rst-state) ((initial-transitions :allocation :class :initform +rst-transitions+)) @@ -1479,10 +1483,12 @@ state should take over.")) than* bullet list items, so it inherits the transition list created in `Body`.")) + +(eval-when (:compile-toplevel :load-toplevel :execute) (defun select-rst-transitions(&rest rest) (mapcan #'(lambda(trans) (when (member (transition-name trans) rest) (list trans))) - +rst-transitions+)) + +rst-transitions+))) (defun invalid-specialised-input(state match) "Not a compound element member. Abort this state machine." diff --git a/parsers/state-machine.lisp b/parsers/state-machine.lisp index cc43751..d23374b 100644 --- a/parsers/state-machine.lisp +++ b/parsers/state-machine.lisp @@ -373,10 +373,11 @@ document structures.") (:documentation "Handle an indented text block. Extend or override in subclasses. Recursively run the state machine for indented blocks")) +(eval-when (:compile-toplevel :load-toplevel :execute) (defparameter +wsp-transitions+ '((blank "^\\s*$" ) (indent "^ +" )) - "Transitons for a wsp state machine") + "Transitons for a wsp state machine")) (defclass wsp-state(state) ((initial-transitions :allocation :class :initform +wsp-transitions+))