diff --git a/js/semantics/CalculusMarkup.lisp b/js/semantics/CalculusMarkup.lisp index 3f194810dfdb..bf5b9e6fef0c 100644 --- a/js/semantics/CalculusMarkup.lisp +++ b/js/semantics/CalculusMarkup.lisp @@ -22,6 +22,9 @@ (defvar *hide-$-nonterminals* t) ; Should rules and actions expanding nonterminals starting with $ be invisible? +(defvar *styled-text-world*) + + (defun hidden-nonterminal? (general-nonterminal) (and *hide-$-nonterminals* (eql (first-symbol-char (general-grammar-symbol-symbol general-nonterminal)) #\$))) @@ -114,48 +117,6 @@ (depict-clear-grammar markup-stream world depict-env))) -;;; ------------------------------------------------------------------------------------------------------ -;;; DEPICTING STYLED TEXT - -; Styled text can include the formats below as long as *styled-text-world* is bound around the call -; to depict-styled-text. - -(defvar *styled-text-world*) - -; (:type ) -(defun depict-styled-text-type (markup-stream type-expression) - (depict-type-expr markup-stream *styled-text-world* type-expression)) - -(setf (styled-text-depictor :type) #'depict-styled-text-type) - - -; (:field ) -(defun depict-styled-text-field (markup-stream name type-expression) - (depict-field-name markup-stream name :reference (scan-type *styled-text-world* type-expression))) - -(setf (styled-text-depictor :field) #'depict-styled-text-field) - - -; (:global ) -(defun depict-styled-text-global-variable (markup-stream name) - (depict-global-variable markup-stream name :reference)) - -(setf (styled-text-depictor :global) #'depict-styled-text-global-variable) - - -; (:local ) -(setf (styled-text-depictor :local) #'depict-local-variable) - - -; (:constant ) -; can be either an integer, a float, a character, or a string. -(setf (styled-text-depictor :constant) #'depict-constant) - - -; (:action ) -(setf (styled-text-depictor :action) #'depict-action-name) - - ;;; ------------------------------------------------------------------------------------------------------ ;;; DEPICTING TYPES @@ -1201,3 +1162,44 @@ ; (terminal-action ) (defun depict-terminal-action (markup-stream world depict-env action-name terminal function-name) (declare (ignore markup-stream world depict-env action-name terminal function-name))) + + +;;; ------------------------------------------------------------------------------------------------------ +;;; DEPICTING STYLED TEXT + +; Styled text can include the formats below as long as *styled-text-world* is bound around the call +; to depict-styled-text. + +; (:type ) +(defun depict-styled-text-type (markup-stream type-expression) + (depict-type-expr markup-stream *styled-text-world* type-expression)) + +(setf (styled-text-depictor :type) #'depict-styled-text-type) + + +; (:field ) +(defun depict-styled-text-field (markup-stream name type-expression) + (depict-field-name markup-stream name :reference (scan-type *styled-text-world* type-expression))) + +(setf (styled-text-depictor :field) #'depict-styled-text-field) + + +; (:global ) +(defun depict-styled-text-global-variable (markup-stream name) + (depict-global-variable markup-stream name :reference)) + +(setf (styled-text-depictor :global) #'depict-styled-text-global-variable) + + +; (:local ) +(setf (styled-text-depictor :local) #'depict-local-variable) + + +; (:constant ) +; can be either an integer, a float, a character, or a string. +(setf (styled-text-depictor :constant) #'depict-constant) + + +; (:action ) +(setf (styled-text-depictor :action) #'depict-action-name) + diff --git a/js2/semantics/CalculusMarkup.lisp b/js2/semantics/CalculusMarkup.lisp index 3f194810dfdb..bf5b9e6fef0c 100644 --- a/js2/semantics/CalculusMarkup.lisp +++ b/js2/semantics/CalculusMarkup.lisp @@ -22,6 +22,9 @@ (defvar *hide-$-nonterminals* t) ; Should rules and actions expanding nonterminals starting with $ be invisible? +(defvar *styled-text-world*) + + (defun hidden-nonterminal? (general-nonterminal) (and *hide-$-nonterminals* (eql (first-symbol-char (general-grammar-symbol-symbol general-nonterminal)) #\$))) @@ -114,48 +117,6 @@ (depict-clear-grammar markup-stream world depict-env))) -;;; ------------------------------------------------------------------------------------------------------ -;;; DEPICTING STYLED TEXT - -; Styled text can include the formats below as long as *styled-text-world* is bound around the call -; to depict-styled-text. - -(defvar *styled-text-world*) - -; (:type ) -(defun depict-styled-text-type (markup-stream type-expression) - (depict-type-expr markup-stream *styled-text-world* type-expression)) - -(setf (styled-text-depictor :type) #'depict-styled-text-type) - - -; (:field ) -(defun depict-styled-text-field (markup-stream name type-expression) - (depict-field-name markup-stream name :reference (scan-type *styled-text-world* type-expression))) - -(setf (styled-text-depictor :field) #'depict-styled-text-field) - - -; (:global ) -(defun depict-styled-text-global-variable (markup-stream name) - (depict-global-variable markup-stream name :reference)) - -(setf (styled-text-depictor :global) #'depict-styled-text-global-variable) - - -; (:local ) -(setf (styled-text-depictor :local) #'depict-local-variable) - - -; (:constant ) -; can be either an integer, a float, a character, or a string. -(setf (styled-text-depictor :constant) #'depict-constant) - - -; (:action ) -(setf (styled-text-depictor :action) #'depict-action-name) - - ;;; ------------------------------------------------------------------------------------------------------ ;;; DEPICTING TYPES @@ -1201,3 +1162,44 @@ ; (terminal-action ) (defun depict-terminal-action (markup-stream world depict-env action-name terminal function-name) (declare (ignore markup-stream world depict-env action-name terminal function-name))) + + +;;; ------------------------------------------------------------------------------------------------------ +;;; DEPICTING STYLED TEXT + +; Styled text can include the formats below as long as *styled-text-world* is bound around the call +; to depict-styled-text. + +; (:type ) +(defun depict-styled-text-type (markup-stream type-expression) + (depict-type-expr markup-stream *styled-text-world* type-expression)) + +(setf (styled-text-depictor :type) #'depict-styled-text-type) + + +; (:field ) +(defun depict-styled-text-field (markup-stream name type-expression) + (depict-field-name markup-stream name :reference (scan-type *styled-text-world* type-expression))) + +(setf (styled-text-depictor :field) #'depict-styled-text-field) + + +; (:global ) +(defun depict-styled-text-global-variable (markup-stream name) + (depict-global-variable markup-stream name :reference)) + +(setf (styled-text-depictor :global) #'depict-styled-text-global-variable) + + +; (:local ) +(setf (styled-text-depictor :local) #'depict-local-variable) + + +; (:constant ) +; can be either an integer, a float, a character, or a string. +(setf (styled-text-depictor :constant) #'depict-constant) + + +; (:action ) +(setf (styled-text-depictor :action) #'depict-action-name) +