This function helps user to add custom font-lock rules to a tree-sitter
major mode.
+---
+** The variable 'rx-constituents' is now obsolete.
+Use 'rx-define', 'rx-let' and 'rx-let-eval' instead.
+
\f
* Changes in Emacs 30.1 on Non-Free Operating Systems
If PRED is non-nil, it is a predicate that all actual arguments must
satisfy.")
+(make-obsolete-variable
+ 'rx-constituents
+ "use `rx-let', `rx-let-eval', or `rx-define' instead."
+ ;; Effectively obsolete since Emacs 27 but only formally declared
+ ;; obsolete in Emacs 30.
+ "30.1")
+
(defvar rx--local-definitions nil
"Alist of dynamic local rx definitions.
Each entry is:
"[^amz]\\S_"))))
(ert-deftest rx-constituents ()
- (let ((rx-constituents
- (append '((beta . gamma)
- (gamma . "a*b")
- (delta . ((lambda (form)
- (regexp-quote (format "<%S>" form)))
- 1 nil symbolp))
- (epsilon . delta))
- rx-constituents)))
- (should (equal (rx-to-string '(seq (+ beta) nonl gamma) t)
- "\\(?:a*b\\)+.\\(?:a*b\\)"))
- (should (equal (rx-to-string '(seq (delta a b c) (* (epsilon d e))) t)
- "\\(?:<(delta a b c)>\\)\\(?:<(epsilon d e)>\\)*"))))
+ (with-suppressed-warnings ((obsolete rx-constituents))
+ (let ((rx-constituents
+ (append '((beta . gamma)
+ (gamma . "a*b")
+ (delta . ((lambda (form)
+ (regexp-quote (format "<%S>" form)))
+ 1 nil symbolp))
+ (epsilon . delta))
+ rx-constituents)))
+ (should (equal (rx-to-string '(seq (+ beta) nonl gamma) t)
+ "\\(?:a*b\\)+.\\(?:a*b\\)"))
+ (should (equal (rx-to-string '(seq (delta a b c) (* (epsilon d e))) t)
+ "\\(?:<(delta a b c)>\\)\\(?:<(epsilon d e)>\\)*")))))
(ert-deftest rx-compat ()
"Test old symbol retained for compatibility (bug#37517)."