149 """ |
149 """ |
150 Public method to treat a function node. |
150 Public method to treat a function node. |
151 |
151 |
152 @param node reference to the node (jasy.script.parse.Node.Node) |
152 @param node reference to the node (jasy.script.parse.Node.Node) |
153 """ |
153 """ |
154 if node.type == "function" and \ |
154 if ( |
155 getattr(node, "name", None) and \ |
155 node.type == "function" and |
156 node.functionForm == "declared_form": |
156 getattr(node, "name", None) and |
|
157 node.functionForm == "declared_form" |
|
158 ): |
157 if self.__stack and self.__stack[-1].endlineno < node.line: |
159 if self.__stack and self.__stack[-1].endlineno < node.line: |
158 del self.__stack[-1] |
160 del self.__stack[-1] |
159 endline = node.line + self.__source.count( |
161 endline = node.line + self.__source.count( |
160 '\n', node.start, node.end) |
162 '\n', node.start, node.end) |
161 if getattr(node, "params", None): |
163 if getattr(node, "params", None): |
223 """ |
225 """ |
224 Public method to treat a variable node. |
226 Public method to treat a variable node. |
225 |
227 |
226 @param node reference to the node (jasy.script.parse.Node.Node) |
228 @param node reference to the node (jasy.script.parse.Node.Node) |
227 """ |
229 """ |
228 if node.type == "var" and \ |
230 if ( |
229 node.parent.type == "script" and \ |
231 node.type == "var" and |
230 node.getChildrenLength(): |
232 node.parent.type == "script" and |
|
233 node.getChildrenLength() |
|
234 ): |
231 if self.__stack and self.__stack[-1].endlineno < node[0].line: |
235 if self.__stack and self.__stack[-1].endlineno < node[0].line: |
232 del self.__stack[-1] |
236 del self.__stack[-1] |
233 if self.__stack: |
237 if self.__stack: |
234 # function variables |
238 # function variables |
235 for var in node: |
239 for var in node: |
249 """ |
253 """ |
250 Public method to treat a constant node. |
254 Public method to treat a constant node. |
251 |
255 |
252 @param node reference to the node (jasy.script.parse.Node.Node) |
256 @param node reference to the node (jasy.script.parse.Node.Node) |
253 """ |
257 """ |
254 if node.type == "const" and \ |
258 if ( |
255 node.parent.type == "script" and \ |
259 node.type == "const" and |
256 node.getChildrenLength(): |
260 node.parent.type == "script" and |
|
261 node.getChildrenLength() |
|
262 ): |
257 if self.__stack and self.__stack[-1].endlineno < node[0].line: |
263 if self.__stack and self.__stack[-1].endlineno < node[0].line: |
258 del self.__stack[-1] |
264 del self.__stack[-1] |
259 if self.__stack: |
265 if self.__stack: |
260 # function variables |
266 # function variables |
261 for var in node: |
267 for var in node: |