proxygen
pump.Cursor Class Reference

Public Member Functions

def __init__ (self, line=-1, column=-1)
 
def __eq__ (self, rhs)
 
def __ne__ (self, rhs)
 
def __lt__ (self, rhs)
 
def __le__ (self, rhs)
 
def __gt__ (self, rhs)
 
def __ge__ (self, rhs)
 
def __str__ (self)
 
def __add__ (self, offset)
 
def __sub__ (self, offset)
 
def Clone (self)
 
def __init__ (self, line=-1, column=-1)
 
def __eq__ (self, rhs)
 
def __ne__ (self, rhs)
 
def __lt__ (self, rhs)
 
def __le__ (self, rhs)
 
def __gt__ (self, rhs)
 
def __ge__ (self, rhs)
 
def __str__ (self)
 
def __add__ (self, offset)
 
def __sub__ (self, offset)
 
def Clone (self)
 
def __init__ (self, line=-1, column=-1)
 
def __eq__ (self, rhs)
 
def __ne__ (self, rhs)
 
def __lt__ (self, rhs)
 
def __le__ (self, rhs)
 
def __gt__ (self, rhs)
 
def __ge__ (self, rhs)
 
def __str__ (self)
 
def __add__ (self, offset)
 
def __sub__ (self, offset)
 
def Clone (self)
 

Public Attributes

 line
 
 column
 

Detailed Description

Represents a position (line and column) in a text file.

Definition at line 87 of file pump.py.

Constructor & Destructor Documentation

def pump.Cursor.__init__ (   self,
  line = -1,
  column = -1 
)

Definition at line 90 of file pump.py.

Referenced by pump.Cursor.__init__().

90  def __init__(self, line=-1, column=-1):
91  self.line = line
92  self.column = column
93 
def __init__(self, line=-1, column=-1)
Definition: pump.py:90
def pump.Cursor.__init__ (   self,
  line = -1,
  column = -1 
)

Definition at line 90 of file pump.py.

References pump.Cursor.__init__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

90  def __init__(self, line=-1, column=-1):
91  self.line = line
92  self.column = column
93 
def __init__(self, line=-1, column=-1)
Definition: pump.py:90
def pump.Cursor.__init__ (   self,
  line = -1,
  column = -1 
)

Definition at line 90 of file pump.py.

References pump.Cursor.__init__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

90  def __init__(self, line=-1, column=-1):
91  self.line = line
92  self.column = column
93 
def __init__(self, line=-1, column=-1)
Definition: pump.py:90

Member Function Documentation

def pump.Cursor.__add__ (   self,
  offset 
)

Definition at line 119 of file pump.py.

References pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

Referenced by pump.Cursor.__add__().

119  def __add__(self, offset):
120  return Cursor(self.line, self.column + offset)
121 
def __add__(self, offset)
Definition: pump.py:119
def pump.Cursor.__add__ (   self,
  offset 
)

Definition at line 119 of file pump.py.

References pump.Cursor.__add__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

119  def __add__(self, offset):
120  return Cursor(self.line, self.column + offset)
121 
def __add__(self, offset)
Definition: pump.py:119
def pump.Cursor.__add__ (   self,
  offset 
)

Definition at line 119 of file pump.py.

References pump.Cursor.__add__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

119  def __add__(self, offset):
120  return Cursor(self.line, self.column + offset)
121 
def __add__(self, offset)
Definition: pump.py:119
def pump.Cursor.__eq__ (   self,
  rhs 
)

Definition at line 94 of file pump.py.

References pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

Referenced by pump.Cursor.__eq__().

94  def __eq__(self, rhs):
95  return self.line == rhs.line and self.column == rhs.column
96 
def __eq__(self, rhs)
Definition: pump.py:94
def pump.Cursor.__eq__ (   self,
  rhs 
)

Definition at line 94 of file pump.py.

References pump.Cursor.__eq__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

94  def __eq__(self, rhs):
95  return self.line == rhs.line and self.column == rhs.column
96 
def __eq__(self, rhs)
Definition: pump.py:94
def pump.Cursor.__eq__ (   self,
  rhs 
)

Definition at line 94 of file pump.py.

References pump.Cursor.__eq__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

94  def __eq__(self, rhs):
95  return self.line == rhs.line and self.column == rhs.column
96 
def __eq__(self, rhs)
Definition: pump.py:94
def pump.Cursor.__ge__ (   self,
  rhs 
)

Definition at line 110 of file pump.py.

References pump.Cursor.__ge__().

110  def __ge__(self, rhs):
111  return rhs <= self
112 
def __ge__(self, rhs)
Definition: pump.py:110
def pump.Cursor.__ge__ (   self,
  rhs 
)

Definition at line 110 of file pump.py.

References pump.Cursor.__ge__().

110  def __ge__(self, rhs):
111  return rhs <= self
112 
def __ge__(self, rhs)
Definition: pump.py:110
def pump.Cursor.__ge__ (   self,
  rhs 
)

Definition at line 110 of file pump.py.

Referenced by pump.Cursor.__ge__().

110  def __ge__(self, rhs):
111  return rhs <= self
112 
def __ge__(self, rhs)
Definition: pump.py:110
def pump.Cursor.__gt__ (   self,
  rhs 
)

Definition at line 107 of file pump.py.

Referenced by pump.Cursor.__gt__().

107  def __gt__(self, rhs):
108  return rhs < self
109 
def __gt__(self, rhs)
Definition: pump.py:107
def pump.Cursor.__gt__ (   self,
  rhs 
)

Definition at line 107 of file pump.py.

References pump.Cursor.__gt__().

107  def __gt__(self, rhs):
108  return rhs < self
109 
def __gt__(self, rhs)
Definition: pump.py:107
def pump.Cursor.__gt__ (   self,
  rhs 
)

Definition at line 107 of file pump.py.

References pump.Cursor.__gt__().

107  def __gt__(self, rhs):
108  return rhs < self
109 
def __gt__(self, rhs)
Definition: pump.py:107
def pump.Cursor.__le__ (   self,
  rhs 
)

Definition at line 104 of file pump.py.

Referenced by pump.Cursor.__le__().

104  def __le__(self, rhs):
105  return self < rhs or self == rhs
106 
def __le__(self, rhs)
Definition: pump.py:104
def pump.Cursor.__le__ (   self,
  rhs 
)

Definition at line 104 of file pump.py.

References pump.Cursor.__le__().

104  def __le__(self, rhs):
105  return self < rhs or self == rhs
106 
def __le__(self, rhs)
Definition: pump.py:104
def pump.Cursor.__le__ (   self,
  rhs 
)

Definition at line 104 of file pump.py.

References pump.Cursor.__le__().

104  def __le__(self, rhs):
105  return self < rhs or self == rhs
106 
def __le__(self, rhs)
Definition: pump.py:104
def pump.Cursor.__lt__ (   self,
  rhs 
)

Definition at line 100 of file pump.py.

References pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

Referenced by pump.Cursor.__lt__().

100  def __lt__(self, rhs):
101  return self.line < rhs.line or (
102  self.line == rhs.line and self.column < rhs.column)
103 
def __lt__(self, rhs)
Definition: pump.py:100
def pump.Cursor.__lt__ (   self,
  rhs 
)

Definition at line 100 of file pump.py.

References pump.Cursor.__lt__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

100  def __lt__(self, rhs):
101  return self.line < rhs.line or (
102  self.line == rhs.line and self.column < rhs.column)
103 
def __lt__(self, rhs)
Definition: pump.py:100
def pump.Cursor.__lt__ (   self,
  rhs 
)

Definition at line 100 of file pump.py.

References pump.Cursor.__lt__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

100  def __lt__(self, rhs):
101  return self.line < rhs.line or (
102  self.line == rhs.line and self.column < rhs.column)
103 
def __lt__(self, rhs)
Definition: pump.py:100
def pump.Cursor.__ne__ (   self,
  rhs 
)

Definition at line 97 of file pump.py.

Referenced by pump.Cursor.__ne__().

97  def __ne__(self, rhs):
98  return not self == rhs
99 
def __ne__(self, rhs)
Definition: pump.py:97
def pump.Cursor.__ne__ (   self,
  rhs 
)

Definition at line 97 of file pump.py.

References pump.Cursor.__ne__().

97  def __ne__(self, rhs):
98  return not self == rhs
99 
def __ne__(self, rhs)
Definition: pump.py:97
def pump.Cursor.__ne__ (   self,
  rhs 
)

Definition at line 97 of file pump.py.

References pump.Cursor.__ne__().

97  def __ne__(self, rhs):
98  return not self == rhs
99 
def __ne__(self, rhs)
Definition: pump.py:97
def pump.Cursor.__str__ (   self)

Definition at line 113 of file pump.py.

References pump.Cursor.__str__(), pump.Cursor.column, pump.Eof(), pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

113  def __str__(self):
114  if self == Eof():
115  return 'EOF'
116  else:
117  return '%s(%s)' % (self.line + 1, self.column)
118 
def __str__(self)
Definition: pump.py:113
def Eof()
Definition: pump.py:132
def pump.Cursor.__str__ (   self)

Definition at line 113 of file pump.py.

References pump.Cursor.column, pump.Eof(), pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

Referenced by pump.Cursor.__str__().

113  def __str__(self):
114  if self == Eof():
115  return 'EOF'
116  else:
117  return '%s(%s)' % (self.line + 1, self.column)
118 
def __str__(self)
Definition: pump.py:113
def Eof()
Definition: pump.py:132
def pump.Cursor.__str__ (   self)

Definition at line 113 of file pump.py.

References pump.Cursor.__str__(), pump.Cursor.column, pump.Eof(), pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

113  def __str__(self):
114  if self == Eof():
115  return 'EOF'
116  else:
117  return '%s(%s)' % (self.line + 1, self.column)
118 
def __str__(self)
Definition: pump.py:113
def Eof()
Definition: pump.py:132
def pump.Cursor.__sub__ (   self,
  offset 
)

Definition at line 122 of file pump.py.

References pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

Referenced by pump.Cursor.__sub__().

122  def __sub__(self, offset):
123  return Cursor(self.line, self.column - offset)
124 
def __sub__(self, offset)
Definition: pump.py:122
def pump.Cursor.__sub__ (   self,
  offset 
)

Definition at line 122 of file pump.py.

References pump.Cursor.__sub__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

122  def __sub__(self, offset):
123  return Cursor(self.line, self.column - offset)
124 
def __sub__(self, offset)
Definition: pump.py:122
def pump.Cursor.__sub__ (   self,
  offset 
)

Definition at line 122 of file pump.py.

References pump.Cursor.__sub__(), pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

122  def __sub__(self, offset):
123  return Cursor(self.line, self.column - offset)
124 
def __sub__(self, offset)
Definition: pump.py:122
def pump.Cursor.Clone (   self)
Returns a copy of self.

Definition at line 125 of file pump.py.

References pump.Cursor.Clone(), pump.Cursor.column, pump.Eof(), pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

125  def Clone(self):
126  """Returns a copy of self."""
127 
128  return Cursor(self.line, self.column)
129 
130 
131 # Special cursor to indicate the end-of-file.
def Clone(self)
Definition: pump.py:125
def pump.Cursor.Clone (   self)
Returns a copy of self.

Definition at line 125 of file pump.py.

References pump.Cursor.Clone(), pump.Cursor.column, pump.Eof(), pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

125  def Clone(self):
126  """Returns a copy of self."""
127 
128  return Cursor(self.line, self.column)
129 
130 
131 # Special cursor to indicate the end-of-file.
def Clone(self)
Definition: pump.py:125
def pump.Cursor.Clone (   self)
Returns a copy of self.

Definition at line 125 of file pump.py.

References pump.Cursor.column, pump.Cursor.line, testing::internal::CodeLocation.line, and testing::internal::AssertHelper::AssertHelperData.line.

Referenced by pump.Cursor.Clone().

125  def Clone(self):
126  """Returns a copy of self."""
127 
128  return Cursor(self.line, self.column)
129 
130 
131 # Special cursor to indicate the end-of-file.
def Clone(self)
Definition: pump.py:125

Member Data Documentation


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