forked from VimPlug/jedi
Some docstrings for the parser.
This commit is contained in:
@@ -47,6 +47,9 @@ class DocstringMixin(object):
|
|||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
|
|
||||||
def get_doc_node(self):
|
def get_doc_node(self):
|
||||||
|
"""
|
||||||
|
Returns the string leaf of a docstring. e.g. `r'foo'`
|
||||||
|
"""
|
||||||
if self.type == 'file_input':
|
if self.type == 'file_input':
|
||||||
node = self.children[0]
|
node = self.children[0]
|
||||||
elif isinstance(self, ClassOrFunc):
|
elif isinstance(self, ClassOrFunc):
|
||||||
|
|||||||
@@ -291,7 +291,9 @@ class Node(BaseNode):
|
|||||||
|
|
||||||
class ErrorNode(BaseNode):
|
class ErrorNode(BaseNode):
|
||||||
"""
|
"""
|
||||||
TODO doc
|
A node that containes valid nodes/leaves that we're follow by a token that
|
||||||
|
was invalid. This basically means that the leaf after this node is where
|
||||||
|
Python would mark a syntax error.
|
||||||
"""
|
"""
|
||||||
__slots__ = ()
|
__slots__ = ()
|
||||||
type = 'error_node'
|
type = 'error_node'
|
||||||
@@ -299,7 +301,8 @@ class ErrorNode(BaseNode):
|
|||||||
|
|
||||||
class ErrorLeaf(Leaf):
|
class ErrorLeaf(Leaf):
|
||||||
"""
|
"""
|
||||||
TODO doc
|
A leaf that is either completely invalid in a language (like `$` in Python)
|
||||||
|
or is invalid at that position. Like the star in `1 +* 1`.
|
||||||
"""
|
"""
|
||||||
__slots__ = ('original_type')
|
__slots__ = ('original_type')
|
||||||
type = 'error_leaf'
|
type = 'error_leaf'
|
||||||
|
|||||||
Reference in New Issue
Block a user