Mercurial > hg > xemacs-beta
comparison lisp/oobr/br-python-ft.el @ 100:4be1180a9e89 r20-1b2
Import from CVS: tag r20-1b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:15:11 +0200 |
parents | 131b0175ea99 |
children |
comparison
equal
deleted
inserted
replaced
99:2d83cbd90d8d | 100:4be1180a9e89 |
---|---|
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: 1-May-96 | 13 ;; LAST-MOD: 23-Dec-96 at 22:09:00 by Bob Weiner |
14 ;; | 14 ;; |
15 ;; Copyright (C) 1990-1995 Free Software Foundation, Inc. | 15 ;; Copyright (C) 1990-1996 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 "[functions]" br-null-path nil)) | 63 (br-add-class "[function]" 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 beginning of widened buffer. | 129 buffer. Assume point is at the beginning of a widened buffer." |
130 '[functions]@- foo@foo(arguments)'" | |
131 (save-excursion | 130 (save-excursion |
132 (let ((routines) class name rout) | 131 (let ((routines) class name rout) |
133 (while (re-search-forward python-routine-def nil t) | 132 (while (re-search-forward python-routine-def nil t) |
134 (setq class "[functions]" | 133 (setq class "[function]" |
135 name (buffer-substring (match-beginning python-feature-name-grpn) | 134 name (buffer-substring (match-beginning python-feature-name-grpn) |
136 (match-end python-feature-name-grpn)) | 135 (match-end python-feature-name-grpn)) |
137 rout (python-feature-normalize | 136 rout (python-feature-normalize |
138 (concat "def " name (python-scan-arguments)) class name) | 137 (concat "def " name (python-scan-arguments)) class name) |
139 routines (cons rout routines))) | 138 routines (cons rout routines))) |
492 (goto-char opoint) | 491 (goto-char opoint) |
493 nil))) | 492 nil))) |
494 | 493 |
495 (defun python-locate-feature (ftr class ftr-pat &optional other-win) | 494 (defun python-locate-feature (ftr class ftr-pat &optional other-win) |
496 ;; 'class' may = nil, implying non-member function | 495 ;; 'class' may = nil, implying non-member function |
497 (or class (setq class "[functions]")) | 496 (or class (setq class "[function]")) |
498 (let ((def-class)) | 497 (let ((def-class)) |
499 (if (and ftr-pat | 498 (if (and ftr-pat |
500 (setq def-class | 499 (setq def-class |
501 (python-find-ancestors-feature (list class) | 500 (python-find-ancestors-feature (list class) |
502 ftr-pat other-win))) | 501 ftr-pat other-win))) |