[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/sql-indent bd39d07 10/13: add explanation on how `sqlin
From: |
Stefan Monnier |
Subject: |
[elpa] externals/sql-indent bd39d07 10/13: add explanation on how `sqlind-beginning-of-block` works |
Date: |
Sun, 11 Feb 2018 22:24:14 -0500 (EST) |
branch: externals/sql-indent
commit bd39d078d23107d59784b17f8e9ff1484bcef131
Author: Alex Harsanyi <address@hidden>
Commit: Alex Harsanyi <address@hidden>
add explanation on how `sqlind-beginning-of-block` works
---
sql-indent.el | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/sql-indent.el b/sql-indent.el
index fcde79f..f2c393b 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -784,6 +784,25 @@ See also `sqlind-beginning-of-block'"
END-STATEMENT-STACK contains a list of \"end\" syntaxes in
reverse order (a stack) and is used to skip over nested blocks."
(interactive)
+ ;; This function works as follows: `sqlind-start-block-regexp` defines the
+ ;; keywords where it stops to inspect the code. Each time it stops at one
+ ;; of these keywords, it checks to see if the keyword is inside a comment or
+ ;; string. If the keyworkd is not inside a comment or string, the
+ ;; `sqlind-maybe-*` functions are called to check if the keyword is valid.
+ ;; Each of these functions will do one of the following:
+ ;;
+ ;; * throw a syntax object with a 'finished tag, if they decide that the
+ ;; keyword is valid
+ ;;
+ ;; * return t to indicate that they decided that the keyword is not valid
+ ;; and `sqlind-beginning-of-block` should search for the next keyword
+ ;;
+ ;; * return nil to indicate that they don't recognize the keyword and
+ ;; another `sqlind-maybe-*` function should be called
+ ;;
+ ;; Some of these `sqlind-maybe-*` functions are specific to the
+ ;; `sql-product` and are only invoked for the speficied SQL dialect.
+
(catch 'finished
(let ((sqlind-end-stmt-stack end-statement-stack))
(while (re-search-backward sqlind-start-block-regexp sqlind-search-limit
'noerror)
- [elpa] externals/sql-indent updated (c3d49c6 -> 44841a8), Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent bd39d07 10/13: add explanation on how `sqlind-beginning-of-block` works,
Stefan Monnier <=
- [elpa] externals/sql-indent 2c9c17f 07/13: Fix typo in sql-indent.org. (#56), Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 283116d 04/13: Correct the adjustment of indentation for operators in select (#52), Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 51b17d6 01/13: Update README with instructions on how to install from GNU ELPA, Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 0bca299 12/13: Fix travis build. (#58), Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 44841a8 13/13: Add .elpaignore file, Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 1b4d0e8 03/13: Add CONTRIBUTING.md file (#51), Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 3ee7f95 08/13: Fix various typos here and there. (#57), Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent d56faed 06/13: Updated documentation, Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 9f716f6 09/13: Recognize PostgreSQL $$ quote syntax, #54 (#55), Stefan Monnier, 2018/02/11
- [elpa] externals/sql-indent 8a1c4ec 05/13: Correct indentation of column continuation with operators. (#53), Stefan Monnier, 2018/02/11