emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/phps-mode 6af98c4 56/96: Productions are now read autom


From: Christian Johansson
Subject: [elpa] externals/phps-mode 6af98c4 56/96: Productions are now read automatically again
Date: Fri, 29 Oct 2021 11:14:46 -0400 (EDT)

branch: externals/phps-mode
commit 6af98c4395cc06a846dca18bfc882c0a2e435dda
Author: Christian Johansson <christian@cvj.se>
Commit: Christian Johansson <christian@cvj.se>

    Productions are now read automatically again
---
 phps-mode-automation-parser-generator.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/phps-mode-automation-parser-generator.el 
b/phps-mode-automation-parser-generator.el
index da445c3..a513afd 100644
--- a/phps-mode-automation-parser-generator.el
+++ b/phps-mode-automation-parser-generator.el
@@ -343,7 +343,7 @@
               token
               `(productions-delimiter ,(match-beginning 0) . ,(match-end 0))))
 
-            ((looking-at "\\([%a-zA-Z_]+\\)")
+            ((looking-at "\\(%?[a-zA-Z_]+\\)")
              (setq
               token
               `(symbol ,(match-beginning 0) . ,(match-end 0))))
@@ -359,7 +359,9 @@
            (let ((token-data
                   (buffer-substring-no-properties
                    (car (cdr token))
-                   (cdr (cdr token)))))))
+                   (cdr (cdr token)))))
+             ;; (message "token-data: %S => %S" token token-data)
+             ))
          token))))
 
   (setq
@@ -383,7 +385,6 @@
 
   (let ((buffer (generate-new-buffer "*buffer*")))
     (switch-to-buffer buffer)
-    (kill-region (point-min) (point-max))
     (insert-file (expand-file-name "zend_language_parser.y"))
     (goto-char (point-min))
     (let ((delimiter-start (search-forward "%%")))
@@ -394,6 +395,9 @@
     (let ((delimiter-start (search-forward "%%")))
       (kill-region delimiter-start (point-max)))
     (goto-char (point-min))
+
+    ;; (message "Buffer:\n%S" (buffer-substring-no-properties (point-min) 
(point-max)))
+    
     (let ((productions (eval (car (read-from-string 
(parser-generator-lr-translate))))))
 
       (let ((context-sensitive-attributes)
@@ -432,6 +436,7 @@
         (setq
          phps-mode-automation-parser-generator--context-sensitive-attributes
          context-sensitive-attributes))
+      (kill-buffer)
 
       (list
        phps-mode-automation-parser-generator--non-terminals
@@ -592,7 +597,6 @@
 
   (let ((buffer (generate-new-buffer "*buffer*")))
     (switch-to-buffer buffer)
-    (kill-region (point-min) (point-max))
     (insert-file (expand-file-name "zend_language_parser.y"))
     (goto-char (point-min))
     (let ((delimiter-start (search-forward "%precedence")))
@@ -622,6 +626,8 @@
         (setq
          phps-mode-automation-parser-generator--attributes
          attributes))
+
+      (kill-buffer)
       
       global-declaration)))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]