branch: externals/phps-mode
commit 13c4c7808a7872063bf5af0e52ef5d84fccafc48
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
More work on heredoc
---
phps-mode-functions.el | 3 ++-
phps-mode-test-functions.el | 14 ++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/phps-mode-functions.el b/phps-mode-functions.el
index 37d38ab..cb1ea0e 100644
--- a/phps-mode-functions.el
+++ b/phps-mode-functions.el
@@ -299,7 +299,8 @@
(setq after-special-control-structure-token token))
;; Keep track of assignments
- (when in-assignment
+ (when (and in-assignment
+ (not in-heredoc))
(if (string= token ";")
(progn
(setq in-assignment nil)
diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el
index bedaedc..04236f3 100644
--- a/phps-mode-test-functions.el
+++ b/phps-mode-test-functions.el
@@ -90,12 +90,6 @@
(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)))))
(phps-mode-test-with-buffer
- "<?php\nclass MyClass extends MyAbstract implements\n myInterface,\n
myInterface2\n{\n}\n"
- "Class multi-line implements"
- (message "Tokens: %s" phps-mode-lexer-tokens)
- (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
-
- (phps-mode-test-with-buffer
"<?php\n$str = <<<'EOD'\nExample of string\nspanning multiple lines\nusing
nowdoc syntax.\nEOD;\n"
"Multi-line NOWDOC string"
(message "Tokens: %s" phps-mode-lexer-tokens)
@@ -107,9 +101,13 @@
(message "Tokens: %s" phps-mode-lexer-tokens)
(should (equal '((1 (0 0)) (2 (0 0)) (3 (0 0)) (4 (0 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
- ;; TODO NOWDOC
+ (phps-mode-test-with-buffer
+ "<?php\nclass MyClass extends MyAbstract implements\n myInterface,\n
myInterface2\n{\n}\n"
+ "Class multi-line implements"
+ (message "Tokens: %s" phps-mode-lexer-tokens)
+ (should (equal '((1 (0 0)) (2 (0 0)) (3 (1 0)) (4 (1 0)) (5 (0 0)) (6 (0
0))) (phps-mode-test-functions--hash-to-list
(phps-mode-functions-get-lines-indent)))))
-(phps-mode-test-with-buffer
+ (phps-mode-test-with-buffer
"<?php\n$var = \"A line\nmore text here\nlast line here\";"
"Multi-line double-quoted string"
(message "Tokens: %s" phps-mode-lexer-tokens)