Esempio 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 = {}
Esempio 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 = {}
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio 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
Esempio n. 9
0
 def write(self, s):
     CCodeWriter.write(self, s)
     self.annotation_buffer.write(s)
Esempio n. 10
0
 def write(self, s):
     CCodeWriter.write(self, s)
     self.annotation_buffer.write(s)