Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 119 lines (86 sloc) 4.364 kB
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
1 ;;; rdebug-regexp.el --- Ruby debugger regular expressions
2
3 ;; Copyright (C) 2007, 2008 Rocky Bernstein (rocky@gnu.org)
4 ;; Copyright (C) 2007, 2008 Anders Lindgren
5
6 ;; $Id: rdebug-regexp.el 724 2008-02-24 16:14:52Z rockyb $
7
8 ;; This program is free software; you can redistribute it and/or modify
9 ;; it under the terms of the GNU General Public License as published by
10 ;; the Free Software Foundation; either version 2, or (at your option)
11 ;; any later version.
12
13 ;; This program is distributed in the hope that it will be useful,
14 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;; GNU General Public License for more details.
17
18 ;; You should have received a copy of the GNU General Public License
19 ;; along with GNU Emacs; see the file COPYING. If not, write to the
20 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 ;; Boston, MA 02111-1307, USA.
22
23 ;;; Commentary:
24
25 ;; See the manual and the file `rdebug.el' for more information.
26
27 ;; Here we have regular expressions and names for matched patterns
28 ;; of those regular expressions.
29
30 ;;; Code:
31
32 ;; -------------------------------------------------------------------
33 ;; Variables defining regular expressions (regexp:s).
34 ;;
35
36 (defconst gud-rdebug-marker-regexp
37 "\\(?:source \\)?\\(\\(?:[a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\).*\n"
38 "Regular expression used to find a file location given by rdebug.
39
40 Program-location lines look like this:
41 source /tmp/gcd.rb:29: gcd
42 /tmp/gcd.rb:29: gcd
43 source /tmp/gcd.rb:29
44 source C:/tmp/gcd.rb:29
45 source \\sources\\capfilterscanner\\capanalyzer.rb:3: <module>")
46
47 (defconst rdebug-annotation-end-regexp
48 "\n"
49 "Regular expression to match the end of an annotation.")
50
51 ;; Examples of annotations:
52 ;; ^Z^Z\n
53 ;; ^Z^Zfoo\n
54 ;; ^Z^Zpre-prompt\n
55 ;; ^Z^Zsource foo.rb:10\n
56
57 (defconst rdebug-annotation-start-regexp
58 "\\(\\([a-z][-a-z]*\\)?\n\\|source \\)"
59 "Regular expression to match the start of an annotation.")
60
61 (defconst rdebug-breakpoint-regexp
62 "^\\ +\\([0-9]+\\) \\([yn]\\) +at +\\(.+\\):\\([0-9]+\\)\\( if .*\\)?$"
63 "Regexp to recognize breakpoint lines in rdebug breakpoint buffers.")
64
65 (defconst rdebug-marker-regexp-file-group 2
66 "Group position in `rdebug-position-regexp' that matches the file name.")
67
68 (defconst rdebug-marker-regexp-line-group 3
69 "Group position in `rdebug-position-regexp' that matches the line number.")
70
71 (defconst rdebug-position-regexp
72 "\\(\\)\\([-a-zA-Z0-9_/.]*\\):\\([0-9]+\\)"
73 "Regular expression for a rdebug position.")
74
75 (defconst rdebug-traceback-line-re
76 "^[ \t]+from \\([^:]+\\):\\([0-9]+\\)\\( in `.*'\\)?"
77 "Regular expression that describes a Ruby traceback line.")
78
79 (defconst rdebug-dollarbang-traceback-line-re
80 "^[ \t]+[[]?\\([^:]+\\):\\([0-9]+\\):in `.*'"
81 "Regular expression that describes a Ruby traceback line from $! list.")
82
83 (defconst rdebug-stack-frame-1st-regexp
84 "^\\(-->\\| \\) +#\\([0-9]+\\)\\(.*\\)"
85 "Regexp to match the first line of a stack frame in rdebug stack buffers.")
86
87 (defconst rdebug-stack-frame-number-group 2
88 "The group position in `rdebug-stack-frame-1st-regexp' that matches the frame number.")
89
90 (defconst rdebug-stack-frame-2nd-regexp
91 "\s+at line +\\([^:]+\\):\\([0-9]+\\)$"
92 "Regexp to match the second line of a stack frame in rdebug stack buffers.")
93
94 (defconst rdebug-stack-frame-2nd-file-group 1
95 "Group position in `rdebug-stack-frame-2nd-regexp' that matches the file name.")
96
97 (defconst rdebug-stack-frame-2nd-line-group 2
98 "Group position in `rdebug-stack-frame-2nd-regexp' that matches the line number.")
99 (defconst rdebug-stack-frame-regexp
100 (concat rdebug-stack-frame-1st-regexp rdebug-stack-frame-2nd-regexp)
101 "Regexp to recognize a stack frame line in rdebug stack buffers.")
102
103 (defconst rdebug-stack-frame-file-group 4
104 "Group position in `rdebug-stack-frame-regexp' that matches the file name.")
105
106 (defconst rdebug-stack-frame-line-group 5
107 "Group position in `rdebug-stack-frame-regexp' that matches the line number.")
108
109 (defconst rdebug-input-prompt-regexp "(+rdb:\\([0-9]+\\|post-mortem\\)) "
110 "Regular expression to recognize a rdebug prompt. Some uses may prepend an anchor to the front.")
111
112 (provide 'rdebug-regexp)
113
114 ;;; Local variables:
115 ;;; eval:(put 'rdebug-debug-enter 'lisp-indent-hook 1)
116 ;;; End:
117
118 ;;; rdebug-regexp.el ends here
Something went wrong with that request. Please try again.