[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/phps-mode d56472c 50/62: Added precedence attributes to
From: |
Christian Johansson |
Subject: |
[elpa] externals/phps-mode d56472c 50/62: Added precedence attributes to grammar |
Date: |
Tue, 20 Apr 2021 10:56:22 -0400 (EDT) |
branch: externals/phps-mode
commit d56472c810ba9070e35ec8a2f019fcafe29600e8
Author: Christian Johansson <christian@mediastrategi.se>
Commit: Christian Johansson <christian@mediastrategi.se>
Added precedence attributes to grammar
---
admin/phps-mode-automation-grammar.el | 27 ++++++++++++++++++++-------
admin/phps-mode-automation.el | 6 ++++++
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/admin/phps-mode-automation-grammar.el
b/admin/phps-mode-automation-grammar.el
index fd6bc01..dc89990 100644
--- a/admin/phps-mode-automation-grammar.el
+++ b/admin/phps-mode-automation-grammar.el
@@ -798,7 +798,7 @@
)
(if_stmt
- (if_stmt_without_else T_NOELSE)
+ (if_stmt_without_else (T_NOELSE (%prec 1)))
(if_stmt_without_else T_ELSE statement)
)
@@ -1060,8 +1060,8 @@
(expr "%" expr)
(expr T_SL expr)
(expr T_SR expr)
- ("+" expr "~")
- ("-" expr "~")
+ ("+" expr ("~" (%prec 1)))
+ ("-" expr ("~" (%prec 1)))
("!" expr)
("~" expr)
(expr T_IS_IDENTICAL expr)
@@ -1119,7 +1119,7 @@
%empty)
(backup_fn_flags
- (PREC_ARROW_FUNCTION %empty))
+ ((PREC_ARROW_FUNCTION (%prec 1)) %empty))
(backup_lex_pos
%empty)
@@ -1373,12 +1373,25 @@
(unless (= (point) index)
(goto-char index))
(phps-mode-lexer--re2c)
- (car
- (nreverse
- phps-mode-lexer--generated-new-tokens))))
+ (when
+ (boundp
+ 'phps-mode-lexer--generated-new-tokens)
+ (car
+ (nreverse
+ phps-mode-lexer--generated-new-tokens)))))
"The custom lex-analyzer.")
(defconst
+ phps-mode-automation-grammar-precendece-attribute
+ '%prec
+ "The precedence attribute of the grammar.")
+
+(defconst
+ phps-mode-automation-grammar-precedence-comparison-function
+ #'>
+ "The precedence comparison function of the grammar.")
+
+(defconst
phps-mode-automation-grammar-lex-analyzer-get-function
(lambda (token)
(with-current-buffer "*phps-mode-lex-analyzer*"
diff --git a/admin/phps-mode-automation.el b/admin/phps-mode-automation.el
index 2171092..7ee0096 100644
--- a/admin/phps-mode-automation.el
+++ b/admin/phps-mode-automation.el
@@ -64,6 +64,12 @@
(setq
parser-generator-lex-analyzer--get-function
phps-mode-automation-grammar-lex-analyzer-get-function)
+ (setq
+ parser-generator-lr--precedence-attribute
+ phps-mode-automation-grammar-precendece-attribute)
+ (setq
+ parser-generator-lr--precedence-comparison-function
+ phps-mode-automation-grammar-precedence-comparison-function)
(parser-generator-process-grammar)
(parser-generator-lr-generate-parser-tables)
- [elpa] externals/phps-mode a900472 29/62: Passed bookkeeping tests, (continued)
- [elpa] externals/phps-mode a900472 29/62: Passed bookkeeping tests, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 685375c 31/62: Passing all unit tests after updated lex-analyzer, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 050fe6a 36/62: Updated version and modified date, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode ec19574 43/62: More implementation of grammar, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode a99284a 39/62: Added TODO item, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 209055b 62/62: Updated date and version, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 86de51b 51/62: Fixed bug with incremental nesting stack, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode a164e82 33/62: Updated README about PHP 8.0 lexer, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 5a3bee3 40/62: More work on implementing PHP 8.0 grammar, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode a4b641d 56/62: Improved Make-script for compile and clean, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode d56472c 50/62: Added precedence attributes to grammar,
Christian Johansson <=
- [elpa] externals/phps-mode e92bed3 54/62: Started debugging failing indentation in some weird cases, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 3fb73ee 37/62: Added bookkeeping support of superglobals $argc, $argv and $http_response_header, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 2efba0b 38/62: Started on generated parser via emacs-parser-generator, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode fd971ee 48/62: Fixed missing lex-analyzer tokens, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 30e1317 59/62: Removed test-file from master branch, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode b04da34 60/62: Fixed tests, only clearing imenu when starting to process changes, if idle inteval is set to nil process changes directly, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode 1991912 49/62: Fixed bug in grammar syntax, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode afaf192 53/62: Resolved conflict, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode daff735 58/62: Removed debug output, Christian Johansson, 2021/04/20
- [elpa] externals/phps-mode b115fdc 57/62: Added ELPA copyright to file missing it, Christian Johansson, 2021/04/20