Ejemplo n.º 1
0
 def __init__(self, f):
     CCodeWriter.__init__(self, self)
     self.buffer = StringIO()
     self.real_f = f
     self.annotations = []
     self.last_pos = None
     self.code = {}
Ejemplo n.º 2
0
 def __init__(self, f):
     CCodeWriter.__init__(self, self)
     self.buffer = StringIO()
     self.real_f = f
     self.annotations = []
     self.last_pos = None
     self.code = {}
Ejemplo n.º 3
0
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         code = self.code.get(self.last_pos[1], "")
         self.code[self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
Ejemplo n.º 4
0
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         code = self.code.get(self.last_pos[1], "")
         self.code[
             self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
Ejemplo n.º 5
0
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         pos_code = self.code.setdefault(self.last_pos[0].filename,{})
         code = pos_code.get(self.last_pos[1], "")
         pos_code[self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
Ejemplo n.º 6
0
 def mark_pos(self, pos):
     if pos is not None:
         CCodeWriter.mark_pos(self, pos)
     if self.last_pos:
         pos_code = self.code.setdefault(self.last_pos[0].filename, {})
         code = pos_code.get(self.last_pos[1], "")
         pos_code[
             self.last_pos[1]] = code + self.annotation_buffer.getvalue()
     self.annotation_buffer = StringIO()
     self.last_pos = pos
Ejemplo n.º 7
0
 def __init__(self, create_from=None, buffer=None, copy_formatting=True):
     CCodeWriter.__init__(self, create_from, buffer, copy_formatting=True)
     if create_from is None:
         self.annotation_buffer = StringIO()
         self.annotations = []
         self.last_pos = None
         self.code = {}
     else:
         # When creating an insertion point, keep references to the same database
         self.annotation_buffer = create_from.annotation_buffer
         self.annotations = create_from.annotations
         self.code = create_from.code
         self.last_pos = create_from.last_pos
Ejemplo n.º 8
0
 def __init__(self, create_from=None, buffer=None, copy_formatting=True):
     CCodeWriter.__init__(self, create_from, buffer, copy_formatting=True)
     if create_from is None:
         self.annotation_buffer = StringIO()
         self.annotations = []
         self.last_pos = None
         self.code = {}
     else:
         # When creating an insertion point, keep references to the same database
         self.annotation_buffer = create_from.annotation_buffer
         self.annotations = create_from.annotations
         self.code = create_from.code
         self.last_pos = create_from.last_pos
Ejemplo n.º 9
0
 def write(self, s):
     CCodeWriter.write(self, s)
     self.annotation_buffer.write(s)
Ejemplo n.º 10
0
 def write(self, s):
     CCodeWriter.write(self, s)
     self.annotation_buffer.write(s)