bitshift/parser/__init__.pytags/v1.0^2
| @@ -18,7 +18,7 @@ class Codelet(object): | |||||
| code was last modified. | code was last modified. | ||||
| :ivar rank: (float) A quanitification of the source code's quality, as | :ivar rank: (float) A quanitification of the source code's quality, as | ||||
| per available ratings (stars, forks, upvotes, etc.). | per available ratings (stars, forks, upvotes, etc.). | ||||
| :ivar symbols: Dictionary containing dictionaries of functions, classes, | |||||
| :ivar symbols: (dict) Dictionary containing dictionaries of functions, classes, | |||||
| variable definitions, etc. | variable definitions, etc. | ||||
| """ | """ | ||||
| @@ -6,7 +6,6 @@ import pygments.lexers as pgl | |||||
| _all__ = ["parse"] | _all__ = ["parse"] | ||||
| # TODO: modify to incorporate tags from stackoverflow | |||||
| def _lang(codelet): | def _lang(codelet): | ||||
| """ | """ | ||||
| Private function to identify the language of a codelet. | Private function to identify the language of a codelet. | ||||
| @@ -14,7 +13,11 @@ def _lang(codelet): | |||||
| :param codelet: The codelet object to identified. | :param codelet: The codelet object to identified. | ||||
| :type code: Codelet | :type code: Codelet | ||||
| .. todo:: | |||||
| Modify function to incorporate tags from stackoverflow. | |||||
| """ | """ | ||||
| if codelet.filename is not None: | if codelet.filename is not None: | ||||
| return pgl.guess_lexer_for_filename(codelet.filename).name | return pgl.guess_lexer_for_filename(codelet.filename).name | ||||
| @@ -28,6 +31,7 @@ def parser(codelet): | |||||
| :type code: Codelet | :type code: Codelet | ||||
| """ | """ | ||||
| lang = _lang(codelet) | lang = _lang(codelet) | ||||
| if lang == LANG_PYTHON: | if lang == LANG_PYTHON: | ||||