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

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

[elpa] master 74eedc2 030/215: Start js lang. add js backtrace regexp


From: Rocky Bernstein
Subject: [elpa] master 74eedc2 030/215: Start js lang. add js backtrace regexp
Date: Sat, 30 Jul 2016 14:48:50 +0000 (UTC)

branch: master
commit 74eedc2e6d22afaf8c6b3d7e6b195c29c5361787
Author: rocky <address@hidden>
Commit: rocky <address@hidden>

    Start js lang. add js backtrace regexp
---
 realgud/debugger/nodejs/init.el             |   13 +++++++--
 realgud/debugger/nodejs/track-mode.el       |    1 +
 realgud/debugger/trepanjs/backtrack-mode.el |    2 +-
 realgud/debugger/trepanjs/init.el           |   11 +++-----
 realgud/debugger/trepanjs/track-mode.el     |   32 +++++++++++++---------
 realgud/lang/js.el                          |   38 +++++++++++++++++++++++++++
 6 files changed, 74 insertions(+), 23 deletions(-)

diff --git a/realgud/debugger/nodejs/init.el b/realgud/debugger/nodejs/init.el
index a988c36..979dfc1 100644
--- a/realgud/debugger/nodejs/init.el
+++ b/realgud/debugger/nodejs/init.el
@@ -23,7 +23,7 @@
                         "../../common/loc"
                         "../../common/init")
                       "realgud-")
-(require-relative-list '("../../lang/posix-shell") "realgud-lang-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
 
 (defvar realgud:nodejs-pat-hash)
 (declare-function make-realgud-loc-pat (realgud-loc))
@@ -70,7 +70,16 @@ realgud-loc-pat struct")
 ;;        :regexp "^[*] \\([0-9]+\\) "
 ;;        :line-group 1))
 
-;; Regular expression that describes a debugger "delete" (breakpoint) response.
+;; Regular expression that describes a V8 backtrace line.
+;; For example:
+;;    at repl:1:7
+;;    at Interface.controlEval 
(/src/external-vcs/github/trepanjs/lib/interface.js:352:18)
+;;    at REPLServer.b [as eval] (domain.js:183:18)
+(setf (gethash "lang-backtrace" realgud:nodejs-pat-hash)
+  realgud:js-backtrace-loc-pat)
+
+;; Regular expression that describes a debugger "delete" (breakpoint)
+;; response.
 ;; For example:
 ;;   Removed 1 breakpoint(s).
 (setf (gethash "brkpt-del" realgud:nodejs-pat-hash)
diff --git a/realgud/debugger/nodejs/track-mode.el 
b/realgud/debugger/nodejs/track-mode.el
index 1ea7795..ff7465c 100644
--- a/realgud/debugger/nodejs/track-mode.el
+++ b/realgud/debugger/nodejs/track-mode.el
@@ -26,6 +26,7 @@
                         )
                       "realgud-")
 (require-relative-list '("core" "init") "realgud:nodejs-")
+;; (require-relative-list '("../../lang/js") "realgud-lang-")
 
 (declare-function realgud:cmd-remap          'realgud-cmds)
 (declare-function realgud:track-set-debugger 'realgud-track-mode)
diff --git a/realgud/debugger/trepanjs/backtrack-mode.el 
b/realgud/debugger/trepanjs/backtrack-mode.el
index 32ee7e7..e3b7e6c 100644
--- a/realgud/debugger/trepanjs/backtrack-mode.el
+++ b/realgud/debugger/trepanjs/backtrack-mode.el
@@ -15,7 +15,7 @@
 ;; You should have received a copy of the GNU General Public License
 ;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-;;; Mode for parsing various kinds of backtraces found in Ruby
+;;; Mode for parsing various kinds of backtraces found in JavaScript
 
 (eval-when-compile (require 'cl))
 (require 'load-relative)
diff --git a/realgud/debugger/trepanjs/init.el 
b/realgud/debugger/trepanjs/init.el
index f1eec60..135fd71 100644
--- a/realgud/debugger/trepanjs/init.el
+++ b/realgud/debugger/trepanjs/init.el
@@ -23,7 +23,7 @@
                         "../../common/loc"
                         "../../common/init")
                       "realgud-")
-(require-relative-list '("../../lang/posix-shell") "realgud-lang-")
+(require-relative-list '("../../lang/js") "realgud-lang-")
 
 (defvar realgud:trepanjs-pat-hash (make-hash-table :test 'equal)
   "Hash key is the what kind of pattern we want to match:
@@ -78,13 +78,10 @@ realgud-loc-pat struct")
 ;;    at Interface.controlEval 
(/src/external-vcs/github/trepanjs/lib/interface.js:352:18)
 ;;    at REPLServer.b [as eval] (domain.js:183:18)
 (setf (gethash "lang-backtrace" realgud:trepanjs-pat-hash)
-  (make-realgud-loc-pat
-   :regexp "^\\(?:[\t ]+at \\)?\\([^:]+\\) (.*:\\([0-9]+\\):\\([0-9]+\\))"
-   :file-group 2
-   :line-group 3
-   :char-offset-group 4))
+  realgud:js-backtrace-loc-pat)
 
-;; Regular expression that describes a debugger "delete" (breakpoint) response.
+;; Regular expression that describes a debugger "delete" (breakpoint)
+;; response.
 ;; For example:
 ;;   Deleted breakpoint 1.
 (setf (gethash "brkpt-del" realgud:trepanjs-pat-hash)
diff --git a/realgud/debugger/trepanjs/track-mode.el 
b/realgud/debugger/trepanjs/track-mode.el
index 4077442..4c02965 100644
--- a/realgud/debugger/trepanjs/track-mode.el
+++ b/realgud/debugger/trepanjs/track-mode.el
@@ -1,5 +1,21 @@
-;;; Copyright (C) 2010, 2012-2015 Rocky Bernstein <address@hidden>
-;;; Ruby "trepanjs" Debugger tracking a comint or eshell buffer.
+;; 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/>.
+
+;;; "trepanjs" Debugger tracking a comint or eshell buffer.
 
 (eval-when-compile (require 'cl))
 (require 'load-relative)
@@ -11,7 +27,7 @@
                         )
                       "realgud-")
 (require-relative-list '("core" "init") "realgud:trepanjs-")
-(require-relative-list '("../../lang/ruby") "realgud-lang-")
+;; (require-relative-list '("../../lang/js") "realgud-lang-")
 
 (declare-function realgud-track-mode 'realgud-track-mode)
 (declare-function realgud-track-mode-hook 'realgud-track-mode)
@@ -28,22 +44,12 @@
 
 (declare-function realgud:ruby-populate-command-keys 'realgud-lang-ruby)
 
-(defun realgud:trepanjs-goto-control-frame-line (pt)
-  "Display the location mentioned by a control-frame line
-described by PT."
-  (interactive "d")
-  (realgud-goto-line-for-pt pt "control-frame"))
-
 (defun realgud:trepanjs-goto-syntax-error-line (pt)
   "Display the location mentioned in a Syntax error line
 described by PT."
   (interactive "d")
   (realgud-goto-line-for-pt pt "syntax-error"))
 
-(realgud:ruby-populate-command-keys trepanjs-track-mode-map)
-
-(define-key trepanjs-track-mode-map
-  (kbd "C-c !c") 'realgud:trepanjs-goto-control-frame-line)
 (define-key trepanjs-track-mode-map
   (kbd "C-c !s") 'realgud:trepanjs-goto-syntax-error-line)
 
diff --git a/realgud/lang/js.el b/realgud/lang/js.el
new file mode 100644
index 0000000..bb5ab38
--- /dev/null
+++ b/realgud/lang/js.el
@@ -0,0 +1,38 @@
+;; 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))
+
+(require 'load-relative)
+(require-relative-list '("../common/regexp" "../common/loc" "../common/track")
+                      "realgud-")
+
+(declare-function realgud-goto-line-for-pt 'realgud-track)
+
+;;  Regular expression that describes a Perl Carp backtrace line.
+;;  at /tmp/foo.pl line 7
+;;     main::__ANON__('Illegal division by zero at /tmp/foo.pl line 4.\x{a}') 
called at /tmp/foo.pl line 4
+;;     main::foo(3) called at /tmp/foo.pl line 8
+(defconst realgud:js-backtrace-loc-pat
+  (make-realgud-loc-pat
+   :regexp "^\\(?:[\t ]+at \\)?\\([^:]+\\) 
(\\(.*\\):\\([0-9]+\\):\\([0-9]+\\))"
+   :file-group 2
+   :line-group 3
+   :char-offset-group 4)
+  "A realgud-loc-pat struct that describes a V8 backtrace location")
+
+(provide-me "realgud-lang-")



reply via email to

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