[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode 7a636ccd28 078/212: Removed obsolete file par
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode 7a636ccd28 078/212: Removed obsolete file parser-grammar-macro.el |
Date: |
Wed, 26 Jan 2022 01:50:57 -0500 (EST) |
branch: externals/phps-mode
commit 7a636ccd28dc84cf84e32feafe441307a04ef0f1
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>
Removed obsolete file parser-grammar-macro.el
---
phps-mode-lexer.el | 31 ++++++++----
phps-mode-parser-grammar-macro.el | 102 --------------------------------------
phps-mode-parser-sdt.el | 32 +++++++++++-
3 files changed, 51 insertions(+), 114 deletions(-)
diff --git a/phps-mode-lexer.el b/phps-mode-lexer.el
index c0f8ef873e..90c10ef07b 100644
--- a/phps-mode-lexer.el
+++ b/phps-mode-lexer.el
@@ -32,7 +32,6 @@
(require 'phps-mode-macros)
-(require 'phps-mode-parser-grammar-macro)
(require 'semantic)
(require 'semantic/lex)
@@ -45,9 +44,19 @@
;; INITIALIZE SETTINGS
-(phps-mode-parser-grammar-macro-CG
+(defvar phps-mode-lexer--CG-data
+ (make-hash-table :test 'equal)
+ "A hash-table with all settings.")
+
+(defun phps-mode-lexer--CG (subject &optional value)
+ "Return and optionally set VALUE of SUBJECT."
+ (if value
+ (puthash subject value phps-mode-lexer--CG-data)
+ (gethash subject phps-mode-lexer--CG-data)))
+
+(phps-mode-lexer--CG
'parser-mode t)
-(phps-mode-parser-grammar-macro-CG
+(phps-mode-lexer--CG
'short-tags t)
@@ -377,8 +386,8 @@
(defun phps-mode-lexer--reset-doc-comment ()
"Reset doc comment."
- (when (phps-mode-parser-grammar-macro-CG 'doc_comment)
- (phps-mode-parser-grammar-macro-CG 'doc_comment nil)))
+ (when (phps-mode-lexer--CG 'doc_comment)
+ (phps-mode-lexer--CG 'doc_comment nil)))
(defun phps-mode-lexer--return-token-with-indent (&optional token start end)
"Return TOKEN with START and END."
@@ -1212,8 +1221,8 @@
(and SHEBANG (looking-at (concat "#!.*" phps-mode-lexer--newline)))
(let ((lineno
(1+
- (phps-mode-parser-grammar-macro-CG 'zend_lineno))))
- (phps-mode-parser-grammar-macro-CG 'zend-lineno lineno))
+ (phps-mode-lexer--CG 'zend_lineno))))
+ (phps-mode-lexer--CG 'zend-lineno lineno))
(phps-mode-lexer--begin 'ST_INITIAL)
(phps-mode-lexer--restart))
@@ -1254,7 +1263,7 @@
(phps-mode-lexer--begin 'ST_IN_SCRIPTING)
(phps-mode-lexer--return-or-skip-token 'T_OPEN_TAG))
- ((phps-mode-parser-grammar-macro-CG 'short-tags)
+ ((phps-mode-lexer--CG 'short-tags)
(phps-mode-lexer--yyless 2)
(setq end (- end 2))
(phps-mode-lexer--begin 'ST_IN_SCRIPTING)
@@ -1268,7 +1277,7 @@
(phps-mode-lexer--match-macro
(and ST_INITIAL (looking-at "<\\?"))
- (if (phps-mode-parser-grammar-macro-CG 'short-tags)
+ (if (phps-mode-lexer--CG 'short-tags)
(progn
(phps-mode-lexer--begin 'ST_IN_SCRIPTING)
(phps-mode-lexer--return-or-skip-token 'T_OPEN_TAG))
@@ -1451,7 +1460,7 @@
(phps-mode-lexer--return-token
'T_DOC_COMMENT
start)
- (phps-mode-parser-grammar-macro-CG 'doc_comment t))
+ (phps-mode-lexer--CG 'doc_comment t))
(phps-mode-lexer--return-token
'T_COMMENT start))
(progn
@@ -1624,7 +1633,7 @@
phps-mode-lexer--heredoc-label-stack)
;; (message "Found heredoc or nowdoc at %s with label %s" data
phps-mode-lexer--heredoc-label)
- (phps-mode-parser-grammar-macro-CG
+ (phps-mode-lexer--CG
'doc_comment
t)
(phps-mode-lexer--return-token
diff --git a/phps-mode-parser-grammar-macro.el
b/phps-mode-parser-grammar-macro.el
deleted file mode 100644
index 526c25303f..0000000000
--- a/phps-mode-parser-grammar-macro.el
+++ /dev/null
@@ -1,102 +0,0 @@
-;;; phps-mode-parser-grammar-macro.el --- Potential grammar macros for parser
-*- lexical-binding:t -*-
-
-;; Copyright (C) 2018-2021 Free Software Foundation, Inc.
-
-;; This program 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 2, or (at
-;; your option) any later version.
-
-;; This program 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 <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Code:
-
-
-(require 'semantic/wisent/grammar)
-
-(defvar phps-mode-parser-grammar-macro-CG-data
- (make-hash-table :test 'equal)
- "A hash-table with all settings.")
-
-(defun phps-mode-parser-grammar-macro-CG (subject &optional value)
- "Return and optionally set VALUE of SUBJECT."
- (if value
- (puthash subject value phps-mode-parser-grammar-macro-CG-data)
- (gethash subject phps-mode-parser-grammar-macro-CG-data)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE (symbol value &rest
attributes)
- "Create AST SYMBOL with VALUE."
- `(wisent-raw-tag
- (semantic-tag ,symbol ,value ,@attributes)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_ASSIGN_OP (symbol
subject object)
- "Create AST assignment."
- `(wisent-raw-tag
- (semantic-tag ,symbol 'ZEND_AST_ASSIGN_OP :object ,object :subject
,subject)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_BINARY_OP (symbol
subject object)
- "Create AST assignment."
- `(wisent-raw-tag
- (semantic-tag ,symbol 'ZEND_AST_BINARY_OP :object ,object :subject
,subject)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_CAST (symbol subject)
- "Create cast."
- `(wisent-raw-tag
- (semantic-tag ,symbol 'ZEND_AST_CAST :subject ,subject)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_EX (symbol operator
&optional subject subject2)
- "Create stuff."
- (let ((attributes `(:operator ,operator)))
- (when subject
- (plist-put attributes :subject subject))
- (when subject2
- (plist-put attributes :subject2 subject2))
- `(wisent-raw-tag
- (semantic-tag ,symbol 'ZEND_AST_EX ,@attributes))))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_LIST_RTRIM (subject)
- `(wisent-raw-tag
- (semantic-tag ,subject 'ZEND_AST_LIST_RTRIM)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_LIST (size type &rest
_elements)
- `(wisent-raw-tag
- (semantic-tag "" ,type :elements @elements :size ,size)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_LIST_ADD (array new-element)
- `(wisent-raw-tag
- (semantic-tag ,array 'ZEND_AST_LIST_ADD :new-element ,new-element)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_NEGATE_NUM_STRING (num-string)
- `(* (string-to-number ,num-string) -1))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_CLASS_CONST_OR_NAME
(object member)
- `(wisent-raw-tag
- (semantic-tag ,object 'ZEND_AST_CLASS_CONST_OR_NAME :member ,member)))
-
-(defun phps-mode-parser-grammar-macro-ZVAL_INTERNED_STR (_callback string)
- "Convert string to symbol."
- `(let ((symbol ',string))
- (funcall callback symbol)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_ZVAL_EX (subject symbol)
- `(wisent-raw-tag
- (semantic-tag ,subject ,symbol)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_AST_CREATE_ZVAL (subject)
- `(wisent-raw-tag
- (semantic-tag ,subject 'ZEND_AST_ZVAL :attr 0)))
-
-(defun phps-mode-parser-grammar-macro-ZEND_LEX_TSTRING (callback)
- (let ((token (semantic-lex (point) (point-max) nil 1)))
- (funcall callback token)))
-
-(provide 'phps-mode-parser-grammar-macro)
-;;; phps-mode-parser-grammar-macro.el ends here
diff --git a/phps-mode-parser-sdt.el b/phps-mode-parser-sdt.el
index 3485fdf0ac..f626b34e78 100644
--- a/phps-mode-parser-sdt.el
+++ b/phps-mode-parser-sdt.el
@@ -8,6 +8,33 @@
;;; Code:
+;; TODO Add SDT for
+;; argument_list
+;; array_pair_list
+;; catch_list
+;; catch_name_list
+;; class_statement_list
+;; echo_expr_list
+;; expr
+;; extends_from
+;; for_exprs
+;; for_statement
+;; foreach_statement
+;; global_var_list
+;; implements_list
+;; inner_statement_list
+;; inner_statement_list
+;; interface_extends_list
+;; isset_variables
+;; lexical_vars
+;; method_body
+;; method_modifiers
+;; optional_expr
+;; statement
+;; variable_modifiers
+
+;; TODO Remove function (phps-mode-parser-sdt--get-list-of-object)
+
(require 'phps-mode-parser)
@@ -165,7 +192,10 @@
(puthash
149
(lambda(args _terminals)
- `(ast-type return-statement optional-expr
,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))))
+ `(ast-type
+ return-statement
+ optional-expr
+ ,(phps-mode-parser-sdt--get-list-of-object (nth 1 args))))
phps-mode-parser--table-translations)
;; statement -> (T_GLOBAL global_var_list ";")
- [elpa] externals/phps-mode 2a4d5dea37 019/212: Passed bookkeeping of function arguments, (continued)
- [elpa] externals/phps-mode 2a4d5dea37 019/212: Passed bookkeeping of function arguments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c29e35fea2 021/212: More work on bookkeeping, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 0daaa97f8d 025/212: SDT for for() loop started, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode fa3681141b 027/212: Passed test for bookkeeping of conditional assignment via parser SDT, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode fc4c763d68 030/212: Added SDT for class properties, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f7c261cee1 032/212: Generate parser command now compatible with latest emacs-parser-generator, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f82c9a377d 033/212: Re-generated parser to verify automation functionality, improved automation documentation, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f858060096 034/212: More work on bookkeeping generated from parser SDT, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode c83b1c264e 060/212: Fixed SDT for isset_variables, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 8fa61fa1f2 063/212: Passing bookkeeping of interface method arguments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7a636ccd28 078/212: Removed obsolete file parser-grammar-macro.el,
Christian Johansson <=
- [elpa] externals/phps-mode ee211dac6a 084/212: Started on indentation tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode f65ca852cd 092/212: Passed another indent test, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 9a2573939a 094/212: More wrestling, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7c0cb57312 098/212: Added more multi-line assignment indent tests, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 3a594466d5 100/212: Passed indent test for multi-line assignments, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 7deebc5f79 101/212: Improved indent test descriptions, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode d5d80017bc 104/212: Passed indent tests for concatenated string, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode e083e90ac0 108/212: Passing more indentation tests for PSR-2, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 84d447e4e6 119/212: Added TODO item, Christian Johansson, 2022/01/26
- [elpa] externals/phps-mode 1ab6ac7324 131/212: Added failing tests for indentation, Christian Johansson, 2022/01/26