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

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

[elpa] master 3a84860 040/215: DRY realgud:regexp-capture-num and add mo


From: Rocky Bernstein
Subject: [elpa] master 3a84860 040/215: DRY realgud:regexp-capture-num and add more FSF copyrights
Date: Sat, 30 Jul 2016 14:48:52 +0000 (UTC)

branch: master
commit 3a8486030e36fe7928cabd45b51f0dbb7eaea137
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    DRY realgud:regexp-capture-num and add more FSF copyrights
---
 realgud/debugger/bashdb/init.el       |   23 +++++++++++++--
 realgud/debugger/bashdb/track-mode.el |   19 +++++++++++-
 realgud/debugger/trepan8/init.el      |    8 +++--
 realgud/debugger/zshdb/init.el        |   21 +++++++++++--
 realgud/lang/posix-shell.el           |   52 +++++++++++++++++++++++----------
 5 files changed, 98 insertions(+), 25 deletions(-)

diff --git a/realgud/debugger/bashdb/init.el b/realgud/debugger/bashdb/init.el
index c8e4559..81cf9b5 100644
--- a/realgud/debugger/bashdb/init.el
+++ b/realgud/debugger/bashdb/init.el
@@ -1,5 +1,21 @@
-;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein <address@hidden>
-;;; Regular expressions for Bash shell debugger: bashdb
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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 3 of the License, 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;; Regular expressions for Bash shell debugger: bashdb
 
 (eval-when-compile (require 'cl))
 
@@ -31,7 +47,8 @@ realgud-loc-pat struct")
 ;;   bashdb<<1>>
 (setf (gethash "prompt" realgud:bashdb-pat-hash)
       (make-realgud-loc-pat
-       :regexp   "^bashdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ "
+       :regexp  (format  "^bashdb[<]+[(]*%s[)]*[>]+ "
+                        realgud:regexp-captured-num)
        :num 1
        ))
 
diff --git a/realgud/debugger/bashdb/track-mode.el 
b/realgud/debugger/bashdb/track-mode.el
index de4478d..7904d25 100644
--- a/realgud/debugger/bashdb/track-mode.el
+++ b/realgud/debugger/bashdb/track-mode.el
@@ -1,5 +1,22 @@
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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 3 of the License, 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 ;;; Copyright (C) 2012-2015 Rocky Bernstein <address@hidden>
-;;; Bash Debugger tracking in a comint buffer.
+
+;; Bash Debugger tracking in a comint or eshell buffer.
 
 (eval-when-compile (require 'cl))
 (require 'load-relative)
diff --git a/realgud/debugger/trepan8/init.el b/realgud/debugger/trepan8/init.el
index a6ba3d4..b6c9e39 100644
--- a/realgud/debugger/trepan8/init.el
+++ b/realgud/debugger/trepan8/init.el
@@ -20,7 +20,8 @@ realgud-loc-pat struct")
 ;;  -- (kernel/common/scope.rb:134 remapped /tmp/scope.rb:134)
 (setf (gethash "loc" realgud:trepan8-pat-hash)
       (make-realgud-loc-pat
-       :regexp ".. (\\(?:.+ \\(?:via\\|remapped\\) 
\\)?\\(.+\\):\\([0-9]+\\)\\(?: @[0-9]+\\)?)"
+       :regexp (format ".. (\\(?:.+ \\(?:via\\|remapped\\) 
\\)?\\(.+\\):%s\\(?: @[0-9]+\\)?)"
+                      realgud:regexp-captured-num)
        :file-group 1
        :line-group 2))
 
@@ -56,7 +57,8 @@ realgud-loc-pat struct")
 ;;   Deleted breakpoint 1.
 (setf (gethash "brkpt-del" realgud:trepan8-pat-hash)
       (make-realgud-loc-pat
-       :regexp "^Deleted breakpoint \\([0-9]+\\).\n"
+       :regexp (format "^Deleted breakpoint %s.\n"
+                      realgud:regexp-captured-num)
        :num 1))
 
 ;;  Regular expression that describes a Ruby $! string
@@ -66,7 +68,7 @@ realgud-loc-pat struct")
 (setf (gethash "trepan8" realgud-pat-hash) realgud:trepan8-pat-hash)
 
 (defconst realgud:trepan8-frame-file-line-regexp
-  " at \\(.*\\):\\([0-9]+\\)$")
+  (format " at \\(.*\\):%s$" realgud:regexp-captured-num))
 
 (defconst realgud:trepan8-frame-start-regexp realgud:trepan-frame-start-regexp)
 (defconst realgud:trepan8-frame-num-regexp   realgud:trepan-frame-start-regexp)
diff --git a/realgud/debugger/zshdb/init.el b/realgud/debugger/zshdb/init.el
index 4931105..e8bc9ff 100644
--- a/realgud/debugger/zshdb/init.el
+++ b/realgud/debugger/zshdb/init.el
@@ -1,5 +1,19 @@
-;;; Copyright (C) 2010, 2014-2015 Rocky Bernstein <address@hidden>
-;;; Regular expressions for Z shell debugger: zshdb
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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 3 of the License, 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 
 (eval-when-compile (require 'cl))
 
@@ -31,7 +45,8 @@ realgud-loc-pat struct")
 ;;   zshdb<<1>>
 (setf (gethash "prompt" realgud:zshdb-pat-hash)
       (make-realgud-loc-pat
-       :regexp   "^zshdb[<]+[(]*\\([0-9]+\\)[)]*[>]+ "
+       :regexp   (format "^zshdb[<]+[(]*%s[)]*[>]+ "
+                        realgud:regexp-captured-num)
        :num 1
        ))
 
diff --git a/realgud/lang/posix-shell.el b/realgud/lang/posix-shell.el
index 3cbc51a..4b5e017 100644
--- a/realgud/lang/posix-shell.el
+++ b/realgud/lang/posix-shell.el
@@ -1,10 +1,27 @@
-;;; Copyright (C) 2010-2011, 2015 Rocky Bernstein <address@hidden>
-;;;
-;;; Common POSIX-Shell like constants and regular expressions.
-;;; Actually a lot of this is not about POSIX shell as it is about the
-;;; common-ness of bashdb, zshdb, and kshdb. But since those are the
-;;; *only* debuggers I know of for POSIX shells, it's not too much of
-;;; a stretch to think of this as for all "shell".
+;; Copyright (C) 2015 Free Software Foundation, Inc
+
+;; Author: Rocky Bernstein <address@hidden>
+
+;; 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 3 of the License, 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+;;
+;; Common POSIX-Shell like constants and regular expressions.
+;; Actually a lot of this is not about POSIX shell as it is about the
+;; common-ness of bashdb, zshdb, and kshdb. But since those are the
+;; *only* debuggers I know of for POSIX shells, it's not too much of
+;; a stretch to think of this as for all "shell".
+
 (eval-when-compile (require 'cl))
 
 (require 'load-relative)
@@ -14,7 +31,8 @@
 
 (defconst realgud-shell-backtrace-loc-pat
   (make-realgud-loc-pat
-   :regexp "^[ \t]+from \\([^:]+\\):\\([0-9]+\\)\\(?: in `.*'\\)?"
+   :regexp (format "^[ \t]+from \\([^:]+\\):%s\\(?: in `.*'\\)?"
+                  realgud:regexp-captured-num)
    :file-group 1
    :line-group 2)
   "A realgud-loc-pat struct that describes a Shell backtrace (or
@@ -24,13 +42,13 @@ traceback) line."  )
   "\\(?:^\\|\n\\)\\(->\\|##\\)")
 
 (defconst realgud-shell-frame-num-regexp
-  "\\([0-9]+\\)")
+  realgud:regexp-captured-num)
 
 (defconst realgud-shell-frame-file-regexp
   "[ \t\n]+\\(?:in\\|from\\) file `\\(.+\\)'")
 
 (defconst realgud-shell-frame-line-regexp
-  "[ \t\n]+at line \\([0-9]+\\)\\(?:\n\\|$\\)")
+  (format "[ \t\n]+at line %s\\(?:\n\\|$\\)" realgud:regexp-captured-num))
 
 (defun realgud-posix-shell-populate-command-keys (&optional map)
   "Bind the debugger function key layout used by many debuggers.
@@ -46,7 +64,9 @@ traceback) line."  )
 ;;   (/etc/init.d/apparmor:35):
 (defconst realgud:POSIX-debugger-loc-pat
       (make-realgud-loc-pat
-       :regexp "\\(?:^\\|\n\\)(\\([^:]+\\):\\([0-9]*\\)):\\(?:\n\\(.+\\)\\)?"
+       :regexp (format
+               "\\(?:^\\|\n\\)(\\([^:]+\\):%s):\\(?:\n\\(.+\\)\\)?"
+               realgud:regexp-captured-num)
        :file-group 1
        :line-group 2
        :text-group 3)
@@ -75,7 +95,8 @@ traceback) line."  )
 ;;  Regular expression that describes a "breakpoint set" line
 (defconst realgud:POSIX-debugger-brkpt-set-pat
   (make-realgud-loc-pat
-   :regexp "^Breakpoint \\([0-9]+\\) set in file \\(.+\\), line 
\\([0-9]+\\).\n"
+   :regexp (format "^Breakpoint \\([0-9]+\\) set in file \\(.+\\), line %s.\n"
+                  realgud:regexp-captured-num)
    :num 1
    :file-group 2
    :line-group 3))
@@ -85,7 +106,8 @@ traceback) line."  )
 ;;   Removed 1 breakpoint(s).
 (defconst realgud:POSIX-debugger-brkpt-del-pat
   (make-realgud-loc-pat
-   :regexp "^Removed \\([0-9]+\\) breakpoint(s).\n"
+   :regexp (format "^Removed %s breakpoint(s).\n"
+                  realgud:regexp-captured-num)
    :num 1))
 
 (defconst realgud:POSIX-debugger-font-lock-keywords
@@ -93,7 +115,7 @@ traceback) line."  )
     ;; The frame number and first type name, if present.
     ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35
     ;;      --^-
-    ("^\\(->\\|##\\)\\([0-9]+\\) "
+    ((format "^\\(->\\|##\\)%s " realgud:regexp-captured-num)
      (2 realgud-backtrace-number-face))
 
     ;; File name.
@@ -106,7 +128,7 @@ traceback) line."  )
     ;; E.g. ->0 in file `/etc/init.d/apparmor' at line 35
     ;;                                         --------^^
     ;; Line number.
-    ("[ \t]+at line \\([0-9]+\\)$"
+    ((format "[ \t]+at line %s$" realgud:regexp-captured-num)
      (1 realgud-line-number-face))
     ;; (trepan-frames-match-current-line
     ;;  (0 trepan-frames-current-frame-face append))



reply via email to

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