<commit_before>;;;;; tré - Copyright (c) 2008-2011 <NAME> <<EMAIL>>

;; Make expander for standard macro which picks macros of the same
;; name in der user-defined expander first.
(defun make-overlayed-std-macro-expander (expander-name)
  (with (e (define-expander expander-name)
         mypred (expander-pred e)
		 mycall (expander-call e))
    (setf (expander-pred e) (lx (mypred)
								(fn (or (funcall ,mypred _)
				 				        (%%macrop _))))
   		  (expander-call e) (lx (mypred mycall)
								(fn (? (funcall ,mypred _)
				 				       (funcall ,mycall _)
				 				       (%%macrocall _)))))))

(defun transpiler-make-std-macro-expander (tr)
 (make-overlayed-std-macro-expander (transpiler-std-macro-expander tr)))

(defun transpiler-make-code-expander (tr)
  (define-expander (transpiler-macro-expander tr)))

(defun transpiler-make-expex (tr)
  (let ex (make-expex)
    (setf (transpiler-expex tr) ex

		  (expex-transpiler ex)
			tr

		  (expex-function-collector ex)
		    (lx (tr)
				#'((fun args)
			         (transpiler-add-wanted-function ,tr fun)))

		  (expex-argument-filter ex)
		    (lx (tr)<commit_msg>When in non-C environment use the standard macros with stage4/expander.lisp.<commit_after>;;;;; tré - Copyright (c) 2008-2011 <NAME> <<EMAIL>>

(defvar *std-macro-expander* nil)

;; Make expander for standard macro which picks macros of the same
;; name in der user-defined expander first.
(defun make-overlayed-std-macro-expander (expander-name)
  (with (e (define-expander expander-name)
         mypred (expander-pred e)
		 mycall (expander-call e))
    (setf (expander-pred e) (lx (mypred)
								(fn (or (funcall ,mypred _)
                                        (aif *std-macro-expander*
                                             (expander-has-macro? 'standard-macros _.)
				 				             (%%macrop _)))))
   		  (expander-call e) (lx (mypred mycall)
								(fn (? (funcall ,mypred _)
				 				       (funcall ,mycall _)
                                       (aif *std-macro-expander*
                                            (with-temporary *current-expander* !
                                              (funcall (expander-call !) _))
				 				            (%%macrocall _))))))))

(defun transpiler-make-std-macro-expander (tr)
 (make-overlayed-std-macro-expander (transpiler-std-macro-expander tr)))

(defun transpiler-make-code-expander (tr)
  (define-expander (transpiler-macro-expander tr)))

(defun transpiler-make-expex (tr)
  (let ex (make-expex)
    (setf (transpiler-expex tr) ex

		  (expex-transpiler ex)
			tr

		  (expex-function-collector ex)
		    (lx (tr)
				#'((fun args)
			         (transpiler-add-wanted-function ,tr fun)))

		  (expex-argument-filter ex)
		    (lx (tr)
{'fraction_non_alphanumeric': 0.1358339402767662, 'fraction_numerical': 0.006190823015294974, 'mean_word_length': 2.183082271147161, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2545477', 'n_tokens_mistral': 1103, 'n_tokens_neox': 917, 'n_words': 213}