Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
BlockFinder Class Reference

Public Member Functions

def __init__
 
def tokeneater
 

Data Fields

 indent
 
 started
 
 last
 

Detailed Description

Provide a tokeneater() method to detect the end of a code block.

Definition at line 475 of file inspect.py.

Constructor & Destructor Documentation

def __init__ (   self)

Definition at line 477 of file inspect.py.

478  def __init__(self):
479  self.indent = 0
480  self.started = 0
481  self.last = 0

Member Function Documentation

def tokeneater (   self,
  type,
  token,
  srow,
  scol,
  erow,
  ecol,
  line 
)

Definition at line 482 of file inspect.py.

References BlockFinder.indent, BlockFinder.last, and BlockFinder.started.

483  def tokeneater(self, type, token, (srow, scol), (erow, ecol), line):
484  if not self.started:
485  if type == tokenize.NAME: self.started = 1
486  elif type == tokenize.NEWLINE:
487  self.last = srow
488  elif type == tokenize.INDENT:
489  self.indent = self.indent + 1
490  elif type == tokenize.DEDENT:
491  self.indent = self.indent - 1
492  if self.indent == 0: raise EndOfBlock, self.last

Field Documentation

indent

Definition at line 478 of file inspect.py.

last

Definition at line 480 of file inspect.py.

started

Definition at line 479 of file inspect.py.


The documentation for this class was generated from the following file: