[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 105fece 149/405: New indent calculation for i
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 105fece 149/405: New indent calculation for inline syntax passes test |
Date: |
Sat, 13 Jul 2019 10:00:02 -0400 (EDT) |
branch: externals/phps-mode
commit 105fecec7230a46e75b43ab5d5e1ac3355762fae
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
New indent calculation for inline syntax passes test
---
phps-mode-functions.el | 2 +-
phps-mode-test-functions.el | 13 +++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index badc339..64d93af 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -200,7 +200,7 @@
(equal after-special-control-structure-token
'T_ELSEIF))
(progn
(when after-special-control-structure-first-on-line
- (setq first-token-is-nesting-decrease t)))
+ (setq first-token-is-nesting-increase t)))
(message "Was inline-control structure %s %s"
after-special-control-structure-token token)
(setq inline-control-structure-level (1+
inline-control-structure-level))
(when after-special-control-structure-first-on-line
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index f5f0536..549d727 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -49,26 +49,27 @@
"Test `phps-mode-functions-get-lines-indent' function."
(phps-mode-test-with-buffer
- "<html><head><title><?php\nif ($myCondition) {\nif ($mySeconCondition)
{\necho $title;\n}\n} ?></title><body>Bla bla</body></html>"
+ "<html><head><title><?php\nif ($myCondition) {\n if ($mySeconCondition)
{\n echo $title;\n } else {\n echo $title2;\n echo
$title3;\n }\n} ?></title><body>Bla bla</body></html>"
"Mixed HTML/PHP"
- (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (1 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (2 0)) (5 (1 0)) (6 (2
0)) (7 (2 0)) (8 (1 0)) (9 (0 0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
- "<?php\nif (true):\n echo 'Something';\nelse:\n echo 'Something
else';\nendif;\necho true;\n"
+ "<?php\nif (true):\n echo 'Something';\nelse:\n echo 'Something
else';\n 'Something else again';\nendif;\necho true;\n"
"Alternative control structures"
- ;; (message "Tokens: %s" phps-mode-lexer-tokens)
- (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (1 0)) (6 (0
0)) (7 (0 0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (1 0)) (6 (1
0)) (7 (0 0)) (8 (0 0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
"<?php\nif (true)\n echo 'Something';\nelse\n echo 'Something
else';\necho true;\n"
"Inline control structures"
- (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (1 0)) (6 (0
1))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (0 0)) (5 (1 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
"<?php\n/**\n* Bla\n*/"
"DOC-COMMENT"
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 1)))
(phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ ;; TODO round and square bracket expressions
+
;; TODO CASE, DEFAULT
;; TODO NOWDOC, HEREDOC
- [elpa] externals/phps-mode 13c4c78 164/405: More work on heredoc, (continued)
- [elpa] externals/phps-mode 13c4c78 164/405: More work on heredoc, Stefan Monnier, 2019/07/13
- [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 <=
- [elpa] externals/phps-mode 0a32b17 161/405: Improved calculation for indentation for multi-line assignments, Stefan Monnier, 2019/07/13
- [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