summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/syntax.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-10-30 21:25:23 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2019-10-30 21:25:23 +0100
commitf7673c147c8c31564dcc19eda12d9c759acee93e (patch)
treed1e85daa9a55f33e617a5bce7f943bdd0fb2fef6 /lisp/emacs-lisp/syntax.el
parentb21ea56edc38112f5ae71d67f335a93b4cc8e3e9 (diff)
downloademacs-f7673c147c8c31564dcc19eda12d9c759acee93e.tar.gz
emacs-f7673c147c8c31564dcc19eda12d9c759acee93e.tar.bz2
emacs-f7673c147c8c31564dcc19eda12d9c759acee93e.zip
Add a new ppss structure for syntax-ppss data
* lisp/emacs-lisp/syntax.el (ppss): Add a new structure to provide accessors to the syntax-ppss data.
Diffstat (limited to 'lisp/emacs-lisp/syntax.el')
-rw-r--r--lisp/emacs-lisp/syntax.el34
1 files changed, 34 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/syntax.el b/lisp/emacs-lisp/syntax.el
index 913e34d5136..9dde325923d 100644
--- a/lisp/emacs-lisp/syntax.el
+++ b/lisp/emacs-lisp/syntax.el
@@ -85,6 +85,40 @@ Put first the functions more likely to cause a change and cheaper to compute.")
;; (i.e. doesn't obey the element t in the buffer-local value).
(make-variable-buffer-local 'syntax-propertize-extend-region-functions)
+(cl-defstruct (ppss
+ (:constructor make-ppss)
+ (:copier nil)
+ (:type list))
+ (depth nil :documentation "depth in parens")
+ (innermost-start
+ nil :documentation
+ "character address of start of innermost containing list; nil if none.")
+ (last-complete-sexp-start
+ nil :documentation
+ "character address of start of last complete sexp terminated.")
+ (string-terminator nil :documentation "\
+non-nil if inside a string.
+(it is the character that will terminate the string, or t if the
+string should be terminated by a generic string delimiter.)")
+ (comment-nesting nil :documentation "\
+nil if outside a comment, t if inside a non-nestable comment,
+else an integer (the current comment nesting).")
+ (after-quote-p nil :documentation "t if following a quote character.")
+ (minimum-paren-depth
+ nil :documentation "the minimum paren-depth encountered during this scan.")
+ (comment-style nil :documentation "style of comment, if any.")
+ (comment-or-string-start
+ nil :documentation
+ "character address of start of comment or string; nil if not in one.")
+ (open-paren-positions
+ nil :documentation
+ "List of positions of currently open parens, outermost first.")
+ (two-character-syntax nil :documentation "\
+When the last position scanned holds the first character of a
+(potential) two character construct, the syntax of that position,
+otherwise nil. That construct can be a two character comment
+delimiter or an Escaped or Char-quoted character."))
+
(defun syntax-propertize-wholelines (start end)
(goto-char start)
(cons (line-beginning-position)