]> git.eshelyaron.com Git - emacs.git/commitdiff
Add a new ppss structure for syntax-ppss data
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 30 Oct 2019 20:25:23 +0000 (21:25 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 30 Oct 2019 20:25:23 +0000 (21:25 +0100)
* lisp/emacs-lisp/syntax.el (ppss): Add a new structure to provide
accessors to the syntax-ppss data.

lisp/emacs-lisp/syntax.el

index 913e34d51364dd3ae09bf47fe02f7c6f04baa34a..9dde325923d2080654e67368da8a28c23f041540 100644 (file)
@@ -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)