[elpa] externals/phps-mode d543750: Improved bookkeeping about class methods, variable references and array variable declarations

2020-09-14 Thread Christian Johansson
branch: externals/phps-mode
commit d5437507eead4229a2468edff07f415411000fd5
Author: Christian Johansson 
Commit: Christian Johansson 

Improved bookkeeping about class methods, variable references and array 
variable declarations
---
 phps-mode-lex-analyzer.el   | 156 +++-
 phps-mode.el|   4 +-
 test/phps-mode-test-lex-analyzer.el |  45 ---
 3 files changed, 117 insertions(+), 88 deletions(-)

diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el
index 316ba68..79d02df 100644
--- a/phps-mode-lex-analyzer.el
+++ b/phps-mode-lex-analyzer.el
@@ -116,44 +116,29 @@
   "Clear region of syntax coloring from START to END."
   (with-silent-modifications (set-text-properties start end nil)))
 
-(defun phps-mode-lex-analyzer--get-token-syntax-color (token &optional 
previous-token previous2-token)
-  "Return syntax color for TOKEN and optionally PREVIOUS-TOKEN and 
PREVIOUS2-TOKEN."
+(defun phps-mode-lex-analyzer--get-token-syntax-color (token)
+  "Return syntax color for TOKEN."
   ;; Syntax coloring
   ;; see 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Faces-for-Font-Lock.html#Faces-for-Font-Lock
   (let* ((start (car (cdr token)))
  (end (cdr (cdr token)))
- (token-name (car token))
- (previous-token-name)
- (previous2-token-name)
- (previous2-token-contents))
-
-;; Catch contexts like $this->abc
-(when (and
-   (equal token-name 'T_STRING)
-   previous-token
-   previous2-token)
-  (setq previous-token-name (car previous-token))
-  (setq previous2-token-name (car previous2-token))
-  (when (and
- (equal previous-token-name 'T_OBJECT_OPERATOR)
- (equal previous2-token-name 'T_VARIABLE))
-(setq previous2-token-contents (downcase 
(buffer-substring-no-properties (car (cdr previous2-token)) (cdr (cdr 
previous2-token)))
+ (bookkeeping-index (list start end))
+ (token-name (car token)))
 
 ;; (message "Color token %s %s %s" token-name start end)
 (cond
 
- ((or (equal token-name 'T_VARIABLE)
-  (and
-   (equal token-name 'T_STRING)
-   (equal previous-token-name 'T_OBJECT_OPERATOR)
-   (equal previous2-token-name 'T_VARIABLE)
-   (string= previous2-token-contents "$this")))
-  (let ((bookkeeping-index (list start end)))
-(if (gethash bookkeeping-index phps-mode-lex-analyzer--bookkeeping)
+ ((and (or (equal token-name 'T_VARIABLE)
+   (equal token-name 'T_STRING))
+   (gethash bookkeeping-index phps-mode-lex-analyzer--bookkeeping))
+  (let ((bookkeeping (gethash bookkeeping-index 
phps-mode-lex-analyzer--bookkeeping)))
+(if (> bookkeeping 0)
 (list 'font-lock-face 'font-lock-variable-name-face)
   (list 'font-lock-face 'font-lock-warning-face
 
- ((equal token-name 'T_STRING_VARNAME)
+ ((or
+   (equal token-name 'T_VARIABLE)
+   (equal token-name 'T_STRING_VARNAME))
   (list 'font-lock-face 'font-lock-variable-name-face))
 
  ((equal token-name 'T_COMMENT)
@@ -332,24 +317,20 @@
 old-start
 phps-mode-lex-analyzer--tokens
 (point-max)))
-  (let ((previous-token)
-(previous2-token))
-(dolist (token phps-mode-lex-analyzer--tokens)
-  (let ((start (car (cdr token)))
-(end (cdr (cdr token)))
-(token-name (car token)))
-
-;; Apply syntax color on token
-(let ((token-syntax-color
-   (phps-mode-lex-analyzer--get-token-syntax-color token 
previous-token previous2-token)))
-  (if token-syntax-color
-  (phps-mode-lex-analyzer--set-region-syntax-color start 
end token-syntax-color)
-(phps-mode-lex-analyzer--clear-region-syntax-color start 
end)))
-(setq previous2-token previous-token)
-(setq previous-token token)
-
-(semantic-lex-push-token
- (semantic-lex-token token-name start end)
+  (dolist (token phps-mode-lex-analyzer--tokens)
+(let ((start (car (cdr token)))
+  (end (cdr (cdr token)))
+  (token-name (car token)))
+
+  ;; Apply syntax color on token
+  (let ((token-syntax-color
+ (phps-mode-lex-analyzer--get-token-syntax-color token)))
+(if token-syntax-color
+(phps-mode-lex-analyzer--set-region-syntax-color start end 
token-syntax-color)
+  (phps-mode-lex-analyzer--clear-region-syntax-color start 
end)))
+
+  (semantic-lex-push-token
+   (semantic-lex-token token-name start end
 
   (setq semantic-lex-end-point (point-max)))
 
@@ -417,17 +398,13 @@
  (phps-

[elpa] externals/elisp-benchmarks updated (c8fe76b -> 72ad57a)

2020-09-14 Thread Andrea Corallo
akrl pushed a change to branch externals/elisp-benchmarks.

  from  c8fe76b   * benchmarks/pcase.el: Don't hide the real `pcase.el`
   new  ed2e954   Revert "* .gitignore: Ignore eln files and eln compile 
folder."
   new  72ad57a   Add new 'inclist-type-hints' benchmark + tag new version


Summary of changes:
 .gitignore   |  2 --
 benchmarks/{inclist.el => inclist-type-hints.el} | 30 +---
 elisp-benchmarks.el  |  2 +-
 3 files changed, 17 insertions(+), 17 deletions(-)
 copy benchmarks/{inclist.el => inclist-type-hints.el} (53%)



[elpa] externals/elisp-benchmarks ed2e954 1/2: Revert "* .gitignore: Ignore eln files and eln compile folder."

2020-09-14 Thread Andrea Corallo
branch: externals/elisp-benchmarks
commit ed2e954e4b20dc83c6632fc5aa3a8438008f6add
Author: Andrea Corallo 
Commit: Andrea Corallo 

Revert "* .gitignore: Ignore eln files and eln compile folder."

This reverts commit 2f653a25d09648128c4c4944496c228cb3443cf7.

No need to ignore these as they are in dedicated caches folders now.
---
 .gitignore | 2 --
 1 file changed, 2 deletions(-)

diff --git a/.gitignore b/.gitignore
index 60f021d..57fbab9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,3 @@
 *.elc
-*.eln
-*/eln-*/
 /elisp-benchmarks-pkg.el
 /elisp-benchmarks-autoloads.el



[elpa] externals/elisp-benchmarks 72ad57a 2/2: Add new 'inclist-type-hints' benchmark + tag new version

2020-09-14 Thread Andrea Corallo
branch: externals/elisp-benchmarks
commit 72ad57a33df403ccd493f445115e4f7833cdc915
Author: Andrea Corallo 
Commit: Andrea Corallo 

Add new 'inclist-type-hints' benchmark + tag new version

* elisp-benchmarks.el: Tag new version.

* benchmarks/inclist-type-hints.el: New benchmark, same as
inclist.el but making use of compiler type hints.
---
 benchmarks/inclist-type-hints.el | 44 
 elisp-benchmarks.el  |  2 +-
 2 files changed, 45 insertions(+), 1 deletion(-)

diff --git a/benchmarks/inclist-type-hints.el b/benchmarks/inclist-type-hints.el
new file mode 100644
index 000..660f4e4
--- /dev/null
+++ b/benchmarks/inclist-type-hints.el
@@ -0,0 +1,44 @@
+;;; bench/inclist-type-hints.el --- Exercise type hints -*- lexical-binding: 
t; -*-
+
+;; Copyright (C) 2020 Free Software Foundation, Inc.
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs.  If not, see .
+
+;;; Commentary:
+
+;; Iteratively increment the elements of a list. Same as inclist.el
+;; but make use of compiler type hints.
+
+;;; Code:
+
+(require 'cl-lib)
+
+(defvar elb-inclist-th-no-type-hints-len 5)
+(defvar elb-inclist-th-no-type-hints-list
+  (mapcar #'random (make-list elb-inclist-th-no-type-hints-len 100)))
+
+(defun elb-inclist-th (l)
+  (declare (cl-optimize (speed 3) (safety 0)))
+  (prog1 l
+(while l
+  (let ((c (cl-the cons l)))
+   (cl-incf (cl-the fixnum (car c)))
+   (setq l (cdr c))
+
+(defun elb-inclist-type-hints-entry ()
+  (let ((l (copy-sequence elb-inclist-th-no-type-hints-list)))
+(cl-loop repeat 1
+do (elb-inclist-th l
diff --git a/elisp-benchmarks.el b/elisp-benchmarks.el
index 4ae4eca..326ff73 100644
--- a/elisp-benchmarks.el
+++ b/elisp-benchmarks.el
@@ -4,7 +4,7 @@
 
 ;; Author: Andrea Corallo 
 ;; Maintainer: Andrea Corallo 
-;; Version: 1.7
+;; Version: 1.8
 ;; Keywords: languages, lisp
 ;; Package-Type: multi
 ;; Created: 2019-01-12