[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 0a32b17 161/405: Improved calculation for ind
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 0a32b17 161/405: Improved calculation for indentation for multi-line assignments |
Date: |
Sat, 13 Jul 2019 10:00:05 -0400 (EDT) |
branch: externals/phps-mode
commit 0a32b17da840d4e05729252a2fffdb9a6d92792c
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Improved calculation for indentation for multi-line assignments
---
phps-mode-functions.el | 5 ++++-
phps-mode-test-functions.el | 16 ++++++++++++++--
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index d488712..eba2a3f 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -307,7 +307,10 @@
(when first-token-on-line
(if (or (equal token 'T_VARIABLE)
(equal token 'T_CONSTANT_ENCAPSED_STRING)
- (equal token 'T_OBJECT_OPERATOR))
+ (equal token 'T_ENCAPSED_AND_WHITESPACE)
+ (equal token 'T_OBJECT_OPERATOR)
+ (equal token 'T_LNUMBER)
+ (equal token 'T_DNUMBER))
(progn
;; (message "In assignment on new-line at %s" token)
(setq in-assignment-on-new-line t))
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 46d0ec5..476869a 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -83,9 +83,21 @@
"Switch, case, default"
(should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (2 0)) (6 (1
0)) (7 (2 0)) (8 (1 0)) (9 (2 0)) (10 (0 0)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
- ;; TODO NOWDOC, HEREDOC
+ (phps-mode-test-with-buffer
+ "<?php\n$var =\n 500 .\n \"200\" .\n 100.0 .\n '200' .\n
$this->getTail()\n ->getBottom();"
+ "Multi-line assignments"
+ ;; (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (1 0)) (6 (1
0)) (7 (1 0)) (8 (1 0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+
+
+ ;; TODO NOWDOC
+
+ ;; TODO HEREDOC
+
+ ;; TODO Multi-line single-quoted string
+
+ ;; TODO Multi-line double-quoted strings
- ;; TODO Multi-line assignments
)
- [elpa] externals/phps-mode 47ffc37 179/405: More work on refactored indentation calculation, (continued)
- [elpa] externals/phps-mode 47ffc37 179/405: More work on refactored indentation calculation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a5ced61 158/405: New indentation function passes all original unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e3eedd7 167/405: Assignment indentation passes tests, class declaration remains, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode e37c1cf 150/405: New indention calculation works with doc-comments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f789468 172/405: Took notes of new indentation tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 20e77aa 181/405: Removed debug output, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 321803a 182/405: Line indents are now cleaning on buffer changes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 38bcabb 176/405: Improved detection of assignment ends in function optional arguments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f1236e2 169/405: Unit tests for indentation calculation for multi-line strings passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 105fece 149/405: New indent calculation for inline syntax passes test, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 0a32b17 161/405: Improved calculation for indentation for multi-line assignments,
Stefan Monnier <=
- [elpa] externals/phps-mode b2eac4d 154/405: More work on switch case default, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 6b5a5c3 155/405: More work on calculating indentations, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ce2d4bd 148/405: New indentation calculation function passes alternative, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 3718931 156/405: Basic tests for indentation calculation passes, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 13e9148 159/405: Indentation unit test for assignment is passing, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b5c64c1 162/405: Added failing tests for HEREDOC and NOWDOC assignments, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f283e4b 173/405: Added new failing unit tests for multiple-lines IF and single line class declaration, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 59474ea 180/405: Improved debugging messages, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 9659ab4 174/405: Added failing test for doc-comments are namespace and class, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode c5d8ec6 168/405: Indentation calculation for class implement working, Stefan Monnier, 2019/07/13