jasy.script.util package¶
Module contents¶
-
jasy.script.util.
assembleDot
(node, result=None)[source]¶ Joins a dot node (cascaded supported, too) into a single string like “foo.bar.Baz”.
-
jasy.script.util.
detectObjectType
(objectNode)[source]¶ Returns a human readable type information of the given node.
-
jasy.script.util.
detectPlusType
(plusNode)[source]¶ Analyses the given “plus” node and tries to figure out if a “string” or “number” result is produced.
-
jasy.script.util.
findAssignments
(name, node)[source]¶ Returns a list of assignments which might have impact on the value used in the given node.
-
jasy.script.util.
findCall
(node, methodName)[source]¶ Recurses the tree starting with the given node and returns the first node which calls the given method name (supports namespaces, too)
-
jasy.script.util.
findCommentNode
(node)[source]¶ Finds the first doc comment node inside the given node.
-
jasy.script.util.
getKeyValue
(dict, key)[source]¶ Returns the value node of the given key inside the given object initializer.
-
jasy.script.util.
getParamNamesFromFunction
(func)[source]¶ Returns a human readable list of parameter names (sorted by their order in the given function)
-
jasy.script.util.
getParameterFromCall
(call, index=0)[source]¶ Returns a parameter node by index on the call node.
-
jasy.script.util.
getVisibility
(name)[source]¶ Returns the visibility of the given name by convention.
-
jasy.script.util.
query
(node, matcher, deep=True, inner=False)[source]¶ Recurses the tree starting with the given node and returns the first node which is matched by the given matcher method.
- node: any node
- matcher: function which should return a truish value when node matches
- deep: whether inner scopes should be scanned, too
- inner: used internally to differentiate between current and inner nodes
-
jasy.script.util.
queryAll
(node, matcher, deep=True, inner=False, result=None)[source]¶ Recurses the tree starting with the given node and returns a list of nodes matched by the given matcher method.
- node: any node
- matcher: function which should return a truish value when node matches
- deep: whether inner scopes should be scanned, too
- inner: used internally to differentiate between current and inner nodes
- result: can be used to extend an existing list, otherwise a new list is created and returned