Utilities/ModuleParser.py

changeset 444
6f3b2099858e
parent 428
58405c24aa09
child 766
0940de08fa75
equal deleted inserted replaced
442:f233430b5613 444:6f3b2099858e
100 \) \s* 100 \) \s*
101 )? 101 )?
102 ^ 102 ^
103 (?P<MethodIndent> [ \t]* ) 103 (?P<MethodIndent> [ \t]* )
104 def [ \t]+ 104 def [ \t]+
105 (?P<MethodName> [a-zA-Z_] \w* ) 105 (?P<MethodName> \w+ )
106 (?: [ \t]* \[ (?: plain | html ) \] )? 106 (?: [ \t]* \[ (?: plain | html ) \] )?
107 [ \t]* \( 107 [ \t]* \(
108 (?P<MethodSignature> (?: [^)] | \)[ \t]*,? )*? ) 108 (?P<MethodSignature> (?: [^)] | \)[ \t]*,? )*? )
109 \) [ \t]* : 109 \) [ \t]* :
110 ) 110 )
111 111
112 | (?P<Class> 112 | (?P<Class>
113 ^ 113 ^
114 (?P<ClassIndent> [ \t]* ) 114 (?P<ClassIndent> [ \t]* )
115 class [ \t]+ 115 class [ \t]+
116 (?P<ClassName> [a-zA-Z_] \w* ) 116 (?P<ClassName> \w+ )
117 [ \t]* 117 [ \t]*
118 (?P<ClassSupers> \( [^)]* \) )? 118 (?P<ClassSupers> \( [^)]* \) )?
119 [ \t]* : 119 [ \t]* :
120 ) 120 )
121 121
122 | (?P<Attribute> 122 | (?P<Attribute>
123 ^ 123 ^
124 (?P<AttributeIndent> [ \t]* ) 124 (?P<AttributeIndent> [ \t]* )
125 self [ \t]* \. [ \t]* 125 self [ \t]* \. [ \t]*
126 (?P<AttributeName> [a-zA-Z_] \w* ) 126 (?P<AttributeName> \w+ )
127 [ \t]* = 127 [ \t]* =
128 ) 128 )
129 129
130 | (?P<Variable> 130 | (?P<Variable>
131 ^ 131 ^
132 (?P<VariableIndent> [ \t]* ) 132 (?P<VariableIndent> [ \t]* )
133 (?P<VariableName> [a-zA-Z_] \w* ) 133 (?P<VariableName> \w+ )
134 [ \t]* = 134 [ \t]* =
135 ) 135 )
136 136
137 | (?P<Import> 137 | (?P<Import>
138 ^ (?: import | from [ \t]+ \. [ \t]+ import ) [ \t]+ 138 ^ (?: import | from [ \t]+ \. [ \t]+ import ) [ \t]+
140 ) 140 )
141 141
142 | (?P<ImportFrom> 142 | (?P<ImportFrom>
143 ^ from [ \t]+ 143 ^ from [ \t]+
144 (?P<ImportFromPath> 144 (?P<ImportFromPath>
145 [a-zA-Z_.] \w* 145 \w+
146 (?: 146 (?:
147 [ \t]* \. [ \t]* [a-zA-Z_] \w* 147 [ \t]* \. [ \t]* \w+
148 )* 148 )*
149 ) 149 )
150 [ \t]+ 150 [ \t]+
151 import [ \t]+ 151 import [ \t]+
152 (?P<ImportFromList> [^#;\n]+ ) 152 (?P<ImportFromList> [^#;\n]+ )

eric ide

mercurial