Back to index

enigmail  1.4.3
Public Member Functions | Public Attributes | Static Private Attributes
pymake.parserdata.Location Class Reference

List of all members.

Public Member Functions

def __init__
def offset
def __str__

Public Attributes

 path
 line
 column

Static Private Attributes

tuple __slots__ = ('path', 'line', 'column')

Detailed Description

A location within a makefile.

For the moment, locations are just path/line/column, but in the future
they may reference parent locations for more accurate "included from"
or "evaled at" error reporting.

Definition at line 9 of file parserdata.py.


Constructor & Destructor Documentation

def pymake.parserdata.Location.__init__ (   self,
  path,
  line,
  column 
)

Definition at line 19 of file parserdata.py.

00019 
00020     def __init__(self, path, line, column):
00021         self.path = path
00022         self.line = line
00023         self.column = column


Member Function Documentation

Definition at line 56 of file parserdata.py.

00056 
00057     def __str__(self):
00058         return "%s:%s:%s" % (self.path, self.line, self.column)

def pymake.parserdata.Location.offset (   self,
  s,
  start,
  end 
)
Returns a new location offset by
the specified string.

Definition at line 24 of file parserdata.py.

00024 
00025     def offset(self, s, start, end):
00026         """
00027         Returns a new location offset by
00028         the specified string.
00029         """
00030 
00031         if start == end:
00032             return self
00033         
00034         skiplines = s.count('\n', start, end)
00035         line = self.line + skiplines
00036         if skiplines:
00037             lastnl = s.rfind('\n', start, end)
00038             assert lastnl != -1
00039             start = lastnl + 1
00040             column = 0
00041         else:
00042             column = self.column
00043 
00044         while True:
00045             j = s.find('\t', start, end)
00046             if j == -1:
00047                 column += end - start
00048                 break
00049 
00050             column += j - start
00051             column += _tabwidth
00052             column -= column % _tabwidth
00053             start = j + 1
00054 
00055         return Location(self.path, line, column)


Member Data Documentation

tuple pymake.parserdata.Location.__slots__ = ('path', 'line', 'column') [static, private]

Definition at line 17 of file parserdata.py.

Definition at line 22 of file parserdata.py.

Definition at line 21 of file parserdata.py.

Definition at line 20 of file parserdata.py.


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