rope.base.simplify

A module to ease code analysis

This module is here to help source code analysis.

Functions

real_code(source)

Simplify source for analysis

ignored_regions(source)

Return ignored regions like strings and comments in source

Module Contents

rope.base.simplify.real_code(source)

Simplify source for analysis

It replaces:

  • comments with spaces

  • strs with a new str filled with spaces

  • implicit and explicit continuations with spaces

  • tabs and semicolons with spaces

The resulting code is a lot easier to analyze if we are interested only in offsets.

rope.base.simplify.ignored_regions(source)

Return ignored regions like strings and comments in source