diff options
Diffstat (limited to 'lisp/emacs-lisp/smie.el')
| -rw-r--r-- | lisp/emacs-lisp/smie.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el index 60d8fa591e9..38a7b8b54c9 100644 --- a/lisp/emacs-lisp/smie.el +++ b/lisp/emacs-lisp/smie.el | |||
| @@ -52,6 +52,13 @@ | |||
| 52 | ;; error because the parser just automatically does something. Better yet, | 52 | ;; error because the parser just automatically does something. Better yet, |
| 53 | ;; we can afford to use a sloppy grammar. | 53 | ;; we can afford to use a sloppy grammar. |
| 54 | 54 | ||
| 55 | ;; The benefits of this approach were presented in the following article, | ||
| 56 | ;; which includes a kind of tutorial to get started with SMIE: | ||
| 57 | ;; | ||
| 58 | ;; SMIE: Weakness is Power! Auto-indentation with incomplete information | ||
| 59 | ;; Stefan Monnier, <Programming> Journal 2020, volumn 5, issue 1. | ||
| 60 | ;; doi: 10.22152/programming-journal.org/2020/5/1 | ||
| 61 | |||
| 55 | ;; A good background to understand the development (especially the parts | 62 | ;; A good background to understand the development (especially the parts |
| 56 | ;; building the 2D precedence tables and then computing the precedence levels | 63 | ;; building the 2D precedence tables and then computing the precedence levels |
| 57 | ;; from it) can be found in pages 187-194 of "Parsing techniques" by Dick Grune | 64 | ;; from it) can be found in pages 187-194 of "Parsing techniques" by Dick Grune |
| @@ -63,6 +70,7 @@ | |||
| 63 | ;; Since then, some of that code has been beaten into submission, but the | 70 | ;; Since then, some of that code has been beaten into submission, but the |
| 64 | ;; smie-indent-keyword is still pretty obscure. | 71 | ;; smie-indent-keyword is still pretty obscure. |
| 65 | 72 | ||
| 73 | |||
| 66 | ;; Conflict resolution: | 74 | ;; Conflict resolution: |
| 67 | ;; | 75 | ;; |
| 68 | ;; - One source of conflicts is when you have: | 76 | ;; - One source of conflicts is when you have: |
| @@ -1356,9 +1364,9 @@ Only meaningful when called from within `smie-rules-function'." | |||
| 1356 | (funcall smie-rules-function :elem 'basic)) | 1364 | (funcall smie-rules-function :elem 'basic)) |
| 1357 | smie-indent-basic)) | 1365 | smie-indent-basic)) |
| 1358 | 1366 | ||
| 1359 | (defun smie-indent--rule (method token | 1367 | (defun smie-indent--rule ( method token |
| 1360 | ;; FIXME: Too many parameters. | 1368 | ;; FIXME: Too many parameters. |
| 1361 | &optional after parent base-pos) | 1369 | &optional after parent base-pos) |
| 1362 | "Compute indentation column according to `smie-rules-function'. | 1370 | "Compute indentation column according to `smie-rules-function'. |
| 1363 | METHOD and TOKEN are passed to `smie-rules-function'. | 1371 | METHOD and TOKEN are passed to `smie-rules-function'. |
| 1364 | AFTER is the position after TOKEN, if known. | 1372 | AFTER is the position after TOKEN, if known. |