[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 02b69f5 304/405: Tests for PSR-2 now passes w
From: |
Stefan Monnier |
Subject: |
[elpa] externals/phps-mode 02b69f5 304/405: Tests for PSR-2 now passes with new algorithms |
Date: |
Sat, 13 Jul 2019 10:00:37 -0400 (EDT) |
branch: externals/phps-mode
commit 02b69f5398582cb54455157604e144312cda8a1f
Author: Christian Johansson <address@hidden>
Commit: Christian Johansson <address@hidden>
Tests for PSR-2 now passes with new algorithms
---
phps-mode-functions.el | 6 +++++-
phps-mode-test-functions.el | 6 +++---
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index e9e54ec..d1cd4e9 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -466,7 +466,11 @@
(and (string= token ",")
(= round-bracket-level (car
in-assignment-round-bracket-level)))
(and (string= token"]")
- (< square-bracket-level (car
in-assignment-square-bracket-level))))
+ (< square-bracket-level (car
in-assignment-square-bracket-level)))
+ (and (equal token 'T_FUNCTION)))
+
+ ;; NOTE Ending an assignment because of function token
is to support PSR-2 Closures
+
(when phps-mode-functions-verbose
(message "Ended assignment"))
(pop in-assignment-square-bracket-level)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index 02f674d..2240251 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -231,7 +231,7 @@
(phps-mode-test-with-buffer
"<?php\nnamespace Vendor\\Package;\n\nclass ClassName\n{\n public
function aVeryLongMethodName(\n ClassTypeHint $arg1,\n &$arg2,\n
array $arg3 = []\n ) {\n // method body\n }\n}"
"PSR-2 : 4.4. Method Arguments : Example 2"
- (message "Indent: %s" (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent)))
+ ;; (message "Indent: %s" (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent)))
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (0 0)) (5 (0 0)) (6 (1
0)) (7 (2 0)) (8 (2 0)) (9 (2 0)) (10 (1 0)) (11 (2 0)) (12 (1 0)) (13 (0 0)))
(phps-mode-test-hash-to-list (phps-mode-functions-get-lines-indent)))))
(phps-mode-test-with-buffer
@@ -298,7 +298,7 @@
(phps-mode-test-with-buffer
"<?php\n$foo->bar(\n $arg1,\n function ($arg2) use ($var1) {\n
// body\n },\n $arg3\n);"
"PSR-2 : 6. Closures : Example 3"
- (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (2 0)) (6 (1
0)) (7 (1 0)) (8 (0 0))) (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent)))))
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (2 0)) (6 (1
0)) (7 (1 0)) (8 (0 0))) (phps-mode-test-hash-to-list
(phps-mode-functions-get-lines-indent)))))
)
@@ -774,7 +774,7 @@
(defun phps-mode-test-functions ()
"Run test for functions."
;; (setq debug-on-error t)
- (setq phps-mode-functions-verbose t)
+ ;; (setq phps-mode-functions-verbose t)
(phps-mode-test-functions-get-lines-lindent-if)
(phps-mode-test-functions-get-lines-indent-classes)
(phps-mode-test-functions-get-lines-indent-inline-if)
- [elpa] externals/phps-mode b31f817 292/405: Added all examples from PSR-2 as tests for indentation, (continued)
- [elpa] externals/phps-mode b31f817 292/405: Added all examples from PSR-2 as tests for indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2087abd 282/405: Added two failing tests for switch indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 43c13b4 295/405: Started on new algorithm for concatenation indentation, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode b2ff76e 283/405: Started on debugging switch indentation bug, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 1aadb1b 285/405: Added failing lexer test for comment vs doc-comment, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 95de04b 274/405: New layout for lexer grammar passes unit tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 00d3568 290/405: Added indentation examples from official PSR-2, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode ec3fd41 289/405: Added failing indent test for mixed concatenation and function call, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode cc77604 284/405: Fixed bug with indentation after switch case statements, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode eeffdb2 315/405: Fixed trailing white-space, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 02b69f5 304/405: Tests for PSR-2 now passes with new algorithms,
Stefan Monnier <=
- [elpa] externals/phps-mode b251a1e 314/405: Got unit tests for wrapping region in symbols working, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 20199b0 307/405: Added byte-compiled Lisp to gitignore, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode a0b7695 316/405: Passes unit tests for integration with electric-pair, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 7c3a31a 305/405: Fixed bug in indentation with stacked assignment closures, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 68422f5 301/405: Restored indentation test for PSR-2 closure, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f3766db 310/405: Fixed byte-compilation in lexer and integration-tests, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 2ec6f6d 306/405: Fixed some compilation warnings, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f2fe751 302/405: More work on trying to get PSR-2 indentation working, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode 8eb3dc0 311/405: Fixed byte-compilation issue in lexer, Stefan Monnier, 2019/07/13
- [elpa] externals/phps-mode f77edf8 308/405: Updated compile command to ignore that files that doesn't compile, Stefan Monnier, 2019/07/13