diff --git a/bitshift/codelet.py b/bitshift/codelet.py index 453ace0..ead8524 100644 --- a/bitshift/codelet.py +++ b/bitshift/codelet.py @@ -18,6 +18,8 @@ class Codelet(object): code was last modified. :ivar rank: (float) A quanitification of the source code's quality, as per available ratings (stars, forks, upvotes, etc.). + :ivar symbols: Dictionary containing dictionaries of functions, classes, + variable definitions, etc. """ def __init__(self, name, code, filename, language, authors, code_url, diff --git a/bitshift/parser/__init__.py b/bitshift/parser/__init__.py index 4d787c7..03d812c 100644 --- a/bitshift/parser/__init__.py +++ b/bitshift/parser/__init__.py @@ -7,13 +7,26 @@ _all__ = ["parse"] # TODO: modify to incorporate tags from stackoverflow def _lang(codelet): + """ + Private function to identify the language of a codelet. + + :param codelet: The codelet object to identified. + + :type code: Codelet + """ if codelet.filename is not None: return pgl.guess_lexer_for_filename(codelet.filename).name return pgl.guess_lexer(codelet.code) -# dispatches the codelet to the correct parser def parser(codelet): + """ + Dispatch codelet to correct parser by language of code. + + :param codelet: The codelet object to parsed. + + :type code: Codelet + """ lang = _lang(codelet) if lang == "Python":