Mercurial > hg > xemacs-beta
comparison lisp/oobr/br-python-ft.el @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 4103f0995bd7 |
children | 4be1180a9e89 |
comparison
equal
deleted
inserted
replaced
69:804d1389bcd6 | 70:131b0175ea99 |
---|---|
8 ;; AUTHOR: Harri Pasanen, based on the C++ feature browser | 8 ;; AUTHOR: Harri Pasanen, based on the C++ feature browser |
9 ;; by Bob Weiner | 9 ;; by Bob Weiner |
10 ;; ORG: Tekla Oy | 10 ;; ORG: Tekla Oy |
11 ;; | 11 ;; |
12 ;; ORIG-DATE: 5-Apr-96 | 12 ;; ORIG-DATE: 5-Apr-96 |
13 ;; LAST-MOD: 23-Dec-96 at 22:09:00 by Bob Weiner | 13 ;; LAST-MOD: 1-May-96 |
14 ;; | 14 ;; |
15 ;; Copyright (C) 1990-1996 Free Software Foundation, Inc. | 15 ;; Copyright (C) 1990-1995 Free Software Foundation, Inc. |
16 ;; See the file BR-COPY for license information. | 16 ;; See the file BR-COPY for license information. |
17 ;; | 17 ;; |
18 ;; This file is part of the OO-Browser. | 18 ;; This file is part of the OO-Browser. |
19 ;; | 19 ;; |
20 ;; DESCRIPTION: | 20 ;; DESCRIPTION: |
58 ;;; ************************************************************************ | 58 ;;; ************************************************************************ |
59 | 59 |
60 (defun python-add-default-classes () | 60 (defun python-add-default-classes () |
61 ;; Add to 'system' class table. | 61 ;; Add to 'system' class table. |
62 ;; Add this default class for global functions | 62 ;; Add this default class for global functions |
63 (br-add-class "[function]" br-null-path nil)) | 63 (br-add-class "[functions]" br-null-path nil)) |
64 | 64 |
65 (defun python-feature-implementors (name) | 65 (defun python-feature-implementors (name) |
66 "Return unsorted list of Python feature tags which implement feature NAME. | 66 "Return unsorted list of Python feature tags which implement feature NAME. |
67 This includes classes which define the interface for NAME as a pure virtual | 67 This includes classes which define the interface for NAME as a pure virtual |
68 function." | 68 function." |
124 (defun python-routine-p (str) | 124 (defun python-routine-p (str) |
125 (string-match "([^\)]*)" str)) | 125 (string-match "([^\)]*)" str)) |
126 | 126 |
127 (defun python-scan-features () | 127 (defun python-scan-features () |
128 "Return reverse ordered list of Python function definitions in current | 128 "Return reverse ordered list of Python function definitions in current |
129 buffer. Assume point is at the beginning of a widened buffer." | 129 buffer. Assume point is at beginning of widened buffer. |
130 '[functions]@- foo@foo(arguments)'" | |
130 (save-excursion | 131 (save-excursion |
131 (let ((routines) class name rout) | 132 (let ((routines) class name rout) |
132 (while (re-search-forward python-routine-def nil t) | 133 (while (re-search-forward python-routine-def nil t) |
133 (setq class "[function]" | 134 (setq class "[functions]" |
134 name (buffer-substring (match-beginning python-feature-name-grpn) | 135 name (buffer-substring (match-beginning python-feature-name-grpn) |
135 (match-end python-feature-name-grpn)) | 136 (match-end python-feature-name-grpn)) |
136 rout (python-feature-normalize | 137 rout (python-feature-normalize |
137 (concat "def " name (python-scan-arguments)) class name) | 138 (concat "def " name (python-scan-arguments)) class name) |
138 routines (cons rout routines))) | 139 routines (cons rout routines))) |
491 (goto-char opoint) | 492 (goto-char opoint) |
492 nil))) | 493 nil))) |
493 | 494 |
494 (defun python-locate-feature (ftr class ftr-pat &optional other-win) | 495 (defun python-locate-feature (ftr class ftr-pat &optional other-win) |
495 ;; 'class' may = nil, implying non-member function | 496 ;; 'class' may = nil, implying non-member function |
496 (or class (setq class "[function]")) | 497 (or class (setq class "[functions]")) |
497 (let ((def-class)) | 498 (let ((def-class)) |
498 (if (and ftr-pat | 499 (if (and ftr-pat |
499 (setq def-class | 500 (setq def-class |
500 (python-find-ancestors-feature (list class) | 501 (python-find-ancestors-feature (list class) |
501 ftr-pat other-win))) | 502 ftr-pat other-win))) |