aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/syntax-tests.el
diff options
context:
space:
mode:
authorAndrea Corallo2020-11-22 22:23:16 +0100
committerAndrea Corallo2020-11-22 22:23:16 +0100
commit033e96055cc172d8d84adc128aee7f7d9889bb00 (patch)
tree4e6e0a24c60f4c8776fb574bf31727dcaf4af4ba /test/src/syntax-tests.el
parent6781cd670d1487bbf0364d80de68ca9733342769 (diff)
parent9b6ad3107f93d40f82c3c53dc0984c6d70aded83 (diff)
downloademacs-033e96055cc172d8d84adc128aee7f7d9889bb00.tar.gz
emacs-033e96055cc172d8d84adc128aee7f7d9889bb00.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'test/src/syntax-tests.el')
-rw-r--r--test/src/syntax-tests.el66
1 files changed, 63 insertions, 3 deletions
diff --git a/test/src/syntax-tests.el b/test/src/syntax-tests.el
index 4b9c3f277aa..edee01ec585 100644
--- a/test/src/syntax-tests.el
+++ b/test/src/syntax-tests.el
@@ -220,7 +220,7 @@ missing or nil, the value of -START- is assumed for it."
220 (cond 220 (cond
221 ((eq -dir- 'forward) t) 221 ((eq -dir- 'forward) t)
222 ((eq -dir- 'backward) nil) 222 ((eq -dir- 'backward) nil)
223 (t (error "Invalid -dir- argument \"%s\" to `syntax-comments'" -dir-)))) 223 (t (error "Invalid -dir- argument \"%s\" to `syntax-br-comments'" -dir-))))
224 (start -start-) 224 (start -start-)
225 (start-str (format "%d" (abs start))) 225 (start-str (format "%d" (abs start)))
226 (type -type-)) 226 (type -type-))
@@ -338,10 +338,14 @@ the `parse-partial-sexp's are expected to stop. See
338 (setq parse-sexp-ignore-comments t) 338 (setq parse-sexp-ignore-comments t)
339 (setq comment-end-can-be-escaped nil) 339 (setq comment-end-can-be-escaped nil)
340 (modify-syntax-entry ?\n ">") 340 (modify-syntax-entry ?\n ">")
341 (modify-syntax-entry ?\; "<")) 341 (modify-syntax-entry ?\; "<")
342 (modify-syntax-entry ?{ ".")
343 (modify-syntax-entry ?} "."))
342(defun \;-out () 344(defun \;-out ()
343 (modify-syntax-entry ?\n " ") 345 (modify-syntax-entry ?\n " ")
344 (modify-syntax-entry ?\; ".")) 346 (modify-syntax-entry ?\; ".")
347 (modify-syntax-entry ?{ "(}")
348 (modify-syntax-entry ?} "){"))
345(eval-and-compile 349(eval-and-compile
346 (setq syntax-comments-section "lisp")) 350 (setq syntax-comments-section "lisp"))
347 351
@@ -353,6 +357,62 @@ the `parse-partial-sexp's are expected to stop. See
353(syntax-comments \; forward t 33) 357(syntax-comments \; forward t 33)
354(syntax-comments \; backward t 33) 358(syntax-comments \; backward t 33)
355 359
360;; "Lisp" style comments inside lists.
361(syntax-br-comments \; backward nil 40)
362(syntax-br-comments \; forward t 41)
363(syntax-br-comments \; backward t 41)
364(syntax-br-comments \; forward t 42)
365(syntax-br-comments \; backward t 42)
366(syntax-br-comments \; forward nil 43)
367
368;; "Lisp" style comments parsed by `parse-partial-sexp'.
369(syntax-pps-comments \; 41 90 91)
370(syntax-pps-comments \; 42 92 93)
371(syntax-pps-comments \; 43 94 95 -999)
372
373;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
374;; "Lisp" style nested comments: between delimiters #| |#.
375;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376(defun \#|-in ()
377 (setq parse-sexp-ignore-comments t)
378 (modify-syntax-entry ?# ". 14")
379 (modify-syntax-entry ?| ". 23n")
380 (modify-syntax-entry ?\; "< b")
381 (modify-syntax-entry ?\n "> b"))
382(defun \#|-out ()
383 (modify-syntax-entry ?# ".")
384 (modify-syntax-entry ?| ".")
385 (modify-syntax-entry ?\; ".")
386 (modify-syntax-entry ?\n " "))
387(eval-and-compile
388 (setq syntax-comments-section "lisp-n"))
389
390(syntax-comments \#| forward nil 100 0)
391(syntax-comments \#| backward nil 100 0)
392(syntax-comments \#| forward nil 101 -999)
393(syntax-comments \#| forward t 102)
394(syntax-comments \#| backward t 102)
395
396(syntax-comments \#| forward t 103)
397(syntax-comments \#| backward t 103)
398(syntax-comments \#| forward t 104)
399(syntax-comments \#| backward t 104)
400
401(syntax-comments \#| forward nil 105 -999)
402(syntax-comments \#| backward t 105)
403(syntax-comments \#| forward t 106)
404(syntax-comments \#| backward t 106)
405(syntax-comments \#| forward t 107)
406(syntax-comments \#| backward t 107)
407
408;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
409;; Mixed "Lisp" style (nested and unnested) comments.
410;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
411(syntax-comments \#| forward t 110)
412(syntax-comments \#| backward t 110)
413(syntax-comments \#| forward t 111)
414(syntax-comments \#| backward t 111)
415
356;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 416;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
357;; Emacs 27 "C" style comments - `comment-end-can-be-escaped' is non-nil. 417;; Emacs 27 "C" style comments - `comment-end-can-be-escaped' is non-nil.
358;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 418;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;