bundles / papyri latest / papyri / tokens / parse_script
function
papyri.tokens:parse_script
source: /papyri/tokens.py :68
Signature
def parse_script ( script : str , ns : dict[str, Any] , prev : str , config : Config , * , where : str | None = None ) → list[tuple[str, str | None]] | None Summary
Parse a script into tokens and use Jedi to infer the fully qualified names of each token.
Parameters
script: strthe script to tokenize and infer types on
ns: dictExtra namespace to use with jedi's Interpreter. This will be used for implicit imports, for example that
npis interpreted as numpy.prev: strprevious lines that lead to this.
where: <Insert Type here><Multiline Description Here>
config: <Insert Type here><Multiline Description Here>
Returns
: List of tuples with:: text:text of the token
reference: strfully qualified name of the type of current token
Aliases
-
papyri.gen.parse_script