branch: externals/phps-mode
commit 18221a85f0350bbb6c9a591312e7d9202757357c
Author: Christian Johansson <[email protected]>
Commit: Christian Johansson <[email protected]>
Added failing parse test for multiple swith case conditions
---
TODO.md | 6 ++++++
phps-mode-macros.el | 2 +-
test/phps-mode-test-parser.el | 6 ++++++
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/TODO.md b/TODO.md
index 75d9351cdb..052f687244 100644
--- a/TODO.md
+++ b/TODO.md
@@ -3,3 +3,9 @@
* Catch signaling from AST-generation, bookkeeping and imenu generation
* Fix HTML/XML indentation support
* Optimize lexer by having predefined lists of lambdas inside a hash-map that
indexes per state of lexer
+* Lexer/parser fix for multiple cases like
+
+ case Type::T_MIXIN:
+ case Type::T_FUNCTION:
+ list(, $block) = $child;
+ // the block need to be able to go up to it's parent env to
resolve var
diff --git a/phps-mode-macros.el b/phps-mode-macros.el
index c3cffb5e82..7d4e2550d7 100644
--- a/phps-mode-macros.el
+++ b/phps-mode-macros.el
@@ -9,7 +9,7 @@
(defconst
phps-mode-macrotime-debug
- nil
+ t
"Debug messages during macro expansion time, default nil.")
(defmacro phps-mode-debug-message (&rest message)
diff --git a/test/phps-mode-test-parser.el b/test/phps-mode-test-parser.el
index d4bcb74a38..f74d2e1a09 100644
--- a/test/phps-mode-test-parser.el
+++ b/test/phps-mode-test-parser.el
@@ -287,6 +287,12 @@
(lambda()
(phps-mode-parser-parse)))
+ (phps-mode-test-parser--buffer-contents
+ "<?php\n$case = 'First';\nswitch ($case)\n{\n case 'First':\n case
'Second':\n echo 'was here';\n}"
+ "Switch case with multiple conditions for same case"
+ (lambda()
+ (phps-mode-parser-parse)))
+
(message "\n-- Ran tests for parser parse. --"))
(defun phps-mode-test-parser ()