3
3
# Distributed under the Boost Software License, Version 1.0.
4
4
# See http://www.boost.org/LICENSE_1_0.txt
5
5
6
- """implements few "find" algorithms on declarations tree"""
6
+ """Implements few "find" algorithms on declarations tree"""
7
7
8
8
import types
9
9
from . import algorithm
10
10
11
11
12
12
class matcher :
13
13
14
- """class -namespace, contains implementation of few "find" algorithms and
14
+ """Class -namespace, contains implementation of few "find" algorithms and
15
15
definition of related exception classes"""
16
16
17
17
class declaration_not_found_t (RuntimeError ):
18
18
19
- """exception , that will be raised, if the declaration could not be
19
+ """Exception , that will be raised, if the declaration could not be
20
20
found"""
21
21
22
22
def __init__ (self , matcher ):
@@ -31,7 +31,7 @@ def __str__(self):
31
31
32
32
class multiple_declarations_found_t (RuntimeError ):
33
33
34
- """exception , that will be raised, if more than one declaration was
34
+ """Exception , that will be raised, if more than one declaration was
35
35
found"""
36
36
37
37
def __init__ (self , matcher ):
@@ -47,15 +47,15 @@ def __str__(self):
47
47
@staticmethod
48
48
def find (decl_matcher , decls , recursive = True ):
49
49
"""
50
- returns a list of declarations that match `decl_matcher` defined
50
+ Returns a list of declarations that match `decl_matcher` defined
51
51
criteria or None
52
52
53
53
:param decl_matcher: Python callable object, that takes one argument -
54
- reference to a declaration
54
+ reference to a declaration
55
55
:param decls: the search scope, :class:declaration_t object or
56
- :class:declaration_t objects list t
56
+ :class:declaration_t objects list t
57
57
:param recursive: boolean, if True, the method will run `decl_matcher`
58
- on the internal declarations too
58
+ on the internal declarations too
59
59
"""
60
60
61
61
where = []
@@ -70,17 +70,17 @@ def find(decl_matcher, decls, recursive=True):
70
70
@staticmethod
71
71
def find_single (decl_matcher , decls , recursive = True ):
72
72
"""
73
- returns a reference to the declaration, that match `decl_matcher`
73
+ Returns a reference to the declaration, that match `decl_matcher`
74
74
defined criteria.
75
75
76
76
if a unique declaration could not be found the method will return None.
77
77
78
78
:param decl_matcher: Python callable object, that takes one argument -
79
- reference to a declaration
79
+ reference to a declaration
80
80
:param decls: the search scope, :class:declaration_t object or
81
- :class:declaration_t objects list t
81
+ :class:declaration_t objects list t
82
82
:param recursive: boolean, if True, the method will run `decl_matcher`
83
- on the internal declarations too
83
+ on the internal declarations too
84
84
"""
85
85
answer = matcher .find (decl_matcher , decls , recursive )
86
86
if len (answer ) == 1 :
@@ -89,18 +89,18 @@ def find_single(decl_matcher, decls, recursive=True):
89
89
@staticmethod
90
90
def get_single (decl_matcher , decls , recursive = True ):
91
91
"""
92
- returns a reference to declaration, that match `decl_matcher` defined
92
+ Returns a reference to declaration, that match `decl_matcher` defined
93
93
criteria.
94
94
95
95
If a unique declaration could not be found, an appropriate exception
96
96
will be raised.
97
97
98
98
:param decl_matcher: Python callable object, that takes one argument -
99
- reference to a declaration
99
+ reference to a declaration
100
100
:param decls: the search scope, :class:declaration_t object or
101
- :class:declaration_t objects list t
101
+ :class:declaration_t objects list t
102
102
:param recursive: boolean, if True, the method will run `decl_matcher`
103
- on the internal declarations too
103
+ on the internal declarations too
104
104
"""
105
105
answer = matcher .find (decl_matcher , decls , recursive )
106
106
if len (answer ) == 1 :
0 commit comments