branch: externals/phps-mode commit 5ae4886f141b21c1521390d8f6670c0e7bac873e Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Updated docs and version --- README.md | 9 ++++----- phps-mode-lexer.el | 21 ++++++++++++--------- phps-mode.el | 4 ++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 48fbf1e335..58f94d6283 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PHPs - Semantic Major-Mode for PHP in Emacs +# PHPs - Emacs major mode for PHP with code intelligence [](https://www.gnu.org/licenses/gpl-3.0.txt) [](https://app.travis-ci.com/github/cjohansson/emacs-phps-mode) @@ -11,7 +11,7 @@ This mode does not require PHP installed on your computer because it has a built * GPLv3 license * Flycheck support with `(phps-mode-flycheck-setup)` -* Semantic lexer based on official PHP 8.0 re2c lexer +* Lexer based on official PHP 8.0 re2c lexer * Syntax coloring based on lexer tokens, makes it easier to spot invalid code * PSR-1, PSR-2 and PSR-12 indentation based on lexer tokens * PSR-1, PSR-2 and PSR-12 supported white-space @@ -31,10 +31,9 @@ This mode does not require PHP installed on your computer because it has a built * Bookkeeping in lexical-analysis, showing defined and undefined variables via syntax coloring (requires a theme that has distinct colors for 'font-lock-warning-face and 'font-lock-variable-name-face) * Canonical LR(1) Parser automatically generated from official PHP 8.0 LALR(1) YACC grammar -## Roadmap +## Issues and roadmap -* 1. Improved token-blind indentation (alternative and inline control structures) -* 2. Bookkeeping and imenu-generation via syntax directed translations via the parser +See [Development](docs/TODO.md) ## Keymap diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el index 60bcc24adb..e3a2193d98 100644 --- a/phps-mode-lexer.el +++ b/phps-mode-lexer.el @@ -204,15 +204,17 @@ (defun phps-mode-lexer--move-forward (position) "Move forward to POSITION." - (setq-local - phps-mode-lex-analyzer--lexer-index - position)) + (when (boundp 'phps-mode-lex-analyzer--lexer-index) + (setq-local + phps-mode-lex-analyzer--lexer-index + position))) (defun phps-mode-lexer--yyless (points) "Move lexer back POINTS." - (setq-local - phps-mode-lex-analyzer--lexer-index - (- phps-mode-lex-analyzer--lexer-index points)) + (when (boundp 'phps-mode-lex-analyzer--lexer-index) + (setq-local + phps-mode-lex-analyzer--lexer-index + (- phps-mode-lex-analyzer--lexer-index points))) (forward-char (- points))) (defun phps-mode-lexer--inline-char-handler () @@ -339,9 +341,10 @@ (setq start (match-beginning 0))) (unless end (setq end (match-end 0))) - (setq-local - phps-mode-lex-analyzer--lexer-index - end)) + (when (boundp 'phps-mode-lex-analyzer--lexer-index) + (setq-local + phps-mode-lex-analyzer--lexer-index + end))) (defmacro phps-mode-lexer--match-macro (states conditions &rest body) "Place in STATES a check for CONDITIONS to execute BODY." diff --git a/phps-mode.el b/phps-mode.el index a5e71ae583..52a0c8442f 100644 --- a/phps-mode.el +++ b/phps-mode.el @@ -5,8 +5,8 @@ ;; Author: Christian Johansson <christ...@cvj.se> ;; Maintainer: Christian Johansson <christ...@cvj.se> ;; Created: 3 Mar 2018 -;; Modified: 7 Nov 2021 -;; Version: 0.4.13 +;; Modified: 26 Jan 2022 +;; Version: 0.4.14 ;; Keywords: tools, convenience ;; URL: https://github.com/cjohansson/emacs-phps-mode