[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode faf6632911 13/15: Improved SDT for more infix
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode faf6632911 13/15: Improved SDT for more infix operators |
Date: |
Sat, 26 Feb 2022 02:06:37 -0500 (EST) |
branch: externals/phps-mode
commit faf6632911fd72b84a83e388aba61434c36b441b
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Improved SDT for more infix operators
---
phps-mode-ast-bookkeeping.el | 18 +++--
phps-mode-parser-sdt.el | 156 ++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 169 insertions(+), 5 deletions(-)
diff --git a/phps-mode-ast-bookkeeping.el b/phps-mode-ast-bookkeeping.el
index 0484eed3cd..79e83e00f0 100644
--- a/phps-mode-ast-bookkeeping.el
+++ b/phps-mode-ast-bookkeeping.el
@@ -602,13 +602,23 @@
;; Infix expressions
((or
- (equal type 'addition-expression)
- (equal type 'boolean-and-expression)
(equal type 'boolean-or-expression)
- (equal type 'logical-and-expression)
+ (equal type 'boolean-and-expression)
(equal type 'logical-or-expression)
+ (equal type 'logical-and-expression)
(equal type 'logical-xor-expression)
- (equal type 'concat-expression))
+ (equal type 'bitwise-or-expression)
+ (equal type 'bitwise-and-expression)
+ (equal type 'bitwise-xor-expression)
+ (equal type 'concat-expression)
+ (equal type 'addition-expression)
+ (equal type 'subtraction-expression)
+ (equal type 'multiplication-expression)
+ (equal type 'exponentiation-expression)
+ (equal type 'division-expression)
+ (equal type 'modulo-expression)
+ (equal type 'bitwise-shift-left-expression)
+ (equal type 'bitwise-shift-right-expression))
(when-let ((bs (reverse (plist-get item 'b))))
(dolist (b bs)
(push `(,scope ,b) bookkeeping-stack)))
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index b72207a1d9..2ee5cae23f 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -1414,6 +1414,62 @@
))
phps-mode-parser--table-translations)
+;; expr -> (expr "|" expr)
+(puthash
+ 384
+ (lambda(args _terminals)
+ `(
+ ast-type
+ bitwise-or-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr T_AMPERSAND_NOT_FOLLOWED_BY_VAR_OR_VARARG expr)
+(puthash
+ 385
+ (lambda(args _terminals)
+ `(
+ ast-type
+ bitwise-and-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr T_AMPERSAND_FOLLOWED_BY_VAR_OR_VARARG expr)
+(puthash
+ 386
+ (lambda(args _terminals)
+ `(
+ ast-type
+ bitwise-and-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr "^" expr)
+(puthash
+ 387
+ (lambda(args _terminals)
+ `(
+ ast-type
+ bitwise-xor-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
;; expr -> (expr "." expr)
(puthash
388
@@ -1430,7 +1486,7 @@
;; expr -> (expr "+" expr)
(puthash
- 397
+ 389
(lambda(args _terminals)
`(
ast-type
@@ -1442,6 +1498,104 @@
))
phps-mode-parser--table-translations)
+;; expr -> (expr "-" expr)
+(puthash
+ 390
+ (lambda(args _terminals)
+ `(
+ ast-type
+ subtraction-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr "*" expr)
+(puthash
+ 391
+ (lambda(args _terminals)
+ `(
+ ast-type
+ multiplication-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr T_POW expr)
+(puthash
+ 392
+ (lambda(args _terminals)
+ `(
+ ast-type
+ exponentiation-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr "/" expr)
+(puthash
+ 393
+ (lambda(args _terminals)
+ `(
+ ast-type
+ division-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr "%" expr)
+(puthash
+ 394
+ (lambda(args _terminals)
+ `(
+ ast-type
+ modulo-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr T_SL expr)
+(puthash
+ 395
+ (lambda(args _terminals)
+ `(
+ ast-type
+ bitwise-shift-left-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
+;; expr -> (expr T_SR expr)
+(puthash
+ 396
+ (lambda(args _terminals)
+ `(
+ ast-type
+ bitwise-shift-right-expression
+ a
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 0 args))
+ b
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 2 args))
+ ))
+ phps-mode-parser--table-translations)
+
;; expr -> ("!" expr)
(puthash
399
- [elpa] externals/phps-mode 924fb345ec 06/15: Minor tweaks in parser generation automation, (continued)
- [elpa] externals/phps-mode 924fb345ec 06/15: Minor tweaks in parser generation automation, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode b82471b38a 09/15: Removed TODO item, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 85eed0d30e 07/15: Updated parser to PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode bc2ecad56a 11/15: More work on PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode b5fcf0e7b7 02/15: Updated automation for PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 3e1142c30c 14/15: Passing bookkeeping tests with PHP 8.1 parser and AST, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode be18349ec9 15/15: Updated version, date and TODO, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode fe89129aaa 03/15: More work on PHP 8.1 automation, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode 10336eed90 08/15: Parser now handles multiple alternative cases switch case statement, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode d7ae56f698 10/15: Passing imenu-tests for PHP 8.1, Christian Johansson, 2022/02/26
- [elpa] externals/phps-mode faf6632911 13/15: Improved SDT for more infix operators,
Christian Johansson <=
- [elpa] externals/phps-mode 16ec02520a 12/15: Fixed ampersand in lexer, Christian Johansson, 2022/02/26