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

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

[elpa] master 9b5e8f4 009/433: Distinguished between Perl sections and p


From: Dmitry Gutov
Subject: [elpa] master 9b5e8f4 009/433: Distinguished between Perl sections and pseudo-Perl sections. The one
Date: Thu, 15 Mar 2018 19:43:25 -0400 (EDT)

branch: master
commit 9b5e8f4d71c77ab2d67873656fe4b0f509afe278
Author: mas <mas>
Commit: mas <mas>

    Distinguished between Perl sections and pseudo-Perl sections.  The one
    inserts ; at the beginning for indentation hack, the other doesn't
    because the Mason syntax doesn't allow it and indentation is generally
    unnecessary anyway.
---
 mmm-mason.el | 31 +++++++++++++++++++++++--------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/mmm-mason.el b/mmm-mason.el
index 3f3c1fa..f55d214 100644
--- a/mmm-mason.el
+++ b/mmm-mason.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2000 by Michael Abraham Shulman
 
 ;; Author: Michael Abraham Shulman <address@hidden>
-;; Version: $Id: mmm-mason.el,v 1.4 2000/05/03 21:48:44 mas Exp $
+;; Version: $Id: mmm-mason.el,v 1.5 2000/05/10 05:28:18 mas Exp $
 
 ;;{{{ GPL
 
@@ -87,9 +87,11 @@ Usually either `perl-mode' or `cperl-mode'. The default is
 `cperl-mode' if that is available, otherwise `perl-mode'.")
 
 (defvar mmm-mason-perl-tags
-  '("perl" "init" "cleanup" "args" "once" "filter" "perl_init"
-    "perl_cleanup" "perl_args" "perl_once" "perl_filter"
-    "attr" "flags" "shared"))
+  '("perl" "init" "cleanup" "once" "filter" "shared"
+    "perl_init" "perl_cleanup" "perl_once" "perl_filter"))
+
+(defvar mmm-mason-pseudo-perl-tags
+  '("args" "perl_args" "attr" "flags"))
 
 (defvar mmm-mason-non-perl-tags
   '("doc" "perl_doc" "text" "perl_text" "def" "perl_def" "method"))
@@ -99,6 +101,11 @@ Usually either `perl-mode' or `cperl-mode'. The default is
   "Matches tags beginning Mason sections containing Perl code.
 Saves the name of the tag matched.")
 
+(defvar mmm-mason-pseudo-perl-tags-regexp
+  (concat "<%" (mmm-regexp-opt mmm-mason-pseudo-perl-tags t) ">")
+  "Match tags beginning Mason sections that look like Perl but aren't.
+Saves the name of the tag matched.")
+
 (defvar mmm-mason-tag-names-regexp
   (regexp-opt (append mmm-mason-perl-tags mmm-mason-non-perl-tags) t)
   "Matches any Mason tag name after the \"<%\". Used to verify that a
@@ -132,17 +139,25 @@ Saves the name of the tag matched.")
     :back "</%~1>"
     :save-matches 1
     :insert ((?, mason-<%TAG> "Perl section: " @ "<%" str ">" @
-                    ";\n" _ "\n" @ "</%" str ">" @)
+                 ";\n" _ "\n" @ "</%" str ">" @)
              (?< mason-<%TAG> ?, . nil)
              (?p mason-<%perl> ?, . "perl")
              (?i mason-<%init> ?, . "init")
-             (?a mason-<%args> ?, . "args")
-             (?f mason-<%flags> ?, . "flags")
-             (?r mason-<%attr> ?, . "attr")
              (?c mason-<%cleanup> ?, . "cleanup")
              (?o mason-<%once> ?, . "once")
              (?l mason-<%filter> ?, . "filter")
              (?s mason-<%shared> ?, . "shared")))
+   (mason-pseudo-perl
+    :submode ,mmm-mason-perl-mode
+    :front ,mmm-mason-pseudo-perl-tags-regexp
+    :back "</%~1>"
+    :save-matches 1
+    :insert ((?. mason-pseudo-<%TAG> "Pseudo-perl section: " @ "<%" str ">" @
+                 "\n" _ "\n" @ "</%" str ">" @)
+             (?> mason-pseudo-<%TAG> ?, . nil)
+             (?a mason-<%args> ?. . "args")
+             (?f mason-<%flags> ?. . "flags")
+             (?r mason-<%attr> ?. . "attr")))
    (mason-inline
     :submode ,mmm-mason-perl-mode
     :front "<%"



reply via email to

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