branch: externals/phps-mode commit 12c22ee27606a25815efbec4cb7a978e82e043d7 Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
More work on alternative and inline meta information --- phps-mode-functions.el | 13 +++++++++---- phps-mode-test-functions.el | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/phps-mode-functions.el b/phps-mode-functions.el index c58cd6a..5dcdc95 100644 --- a/phps-mode-functions.el +++ b/phps-mode-functions.el @@ -320,11 +320,16 @@ (= after-special-control-structure round-brace-level) (not (string= token ")")) (not (string= token "("))) - (if (not (string= token "{")) + (when (not (string= token "{")) + (message "After special control structure %s in buffer: %s tokens: %s token-start: %s" token (buffer-substring-no-properties (point-min) (point-max)) phps-mode-lexer-tokens token-start) + (if (string= token ":") + (progn + (setq start-alternative-control-structure-level (+ start-alternative-control-structure-level 1)) + (message "Was colon")) (progn - (message "After special control structure %s in buffer: %s tokens: %s token-start: %s" token (buffer-substring-no-properties (point-min) (point-max)) phps-mode-lexer-tokens token-start)) - ;; (message "Not after special control structure %s in buffer %s" token (buffer-substring-no-properties (point-min) (point-max))) - ) + (setq start-inline-control-structure-level (+ start-inline-control-structure-level 1)) + (message "Was not colon")))) + (setq after-special-control-structure nil)) ;; Does the token support inline and alternative syntax? diff --git a/phps-mode-test-functions.el b/phps-mode-test-functions.el index a0cef01..ec25aaa 100644 --- a/phps-mode-test-functions.el +++ b/phps-mode-test-functions.el @@ -338,7 +338,7 @@ (phps-mode-test-with-buffer "<?php\nif ($myCondition)\n echo 'was here';\necho 'was here 2';\n" (goto-char 41) - (should (equal (list (list t 0 0 0 1 0 4 nil) (list t 0 0 0 0 0 8 nil)) (phps-mode-functions-get-point-data)))) + (should (equal (list (list t 0 0 0 1 0 4 nil) (list t 0 0 0 0 0 7 nil)) (phps-mode-functions-get-point-data)))) (phps-mode-test-with-buffer "<?php\nif ($myCondition)\n echo 'was here';\necho 'was here 2';\n"