1: #line 305 "tanglers.ipk"
2:
3:
4:
5: from interscript.tanglers.base import tangler_base
6: import re
7:
8: class cpp_tangler(tangler_base):
9: def __init__(self,sink,weaver):
10: tangler_base.__init__(self,sink,weaver)
11: self.matchid = re.compile('^[^A-Za-z_]*([A-Za-z_][A-Za-z_0-9]*)(.*)$')
12: self.language = 'C++'
13:
14: def write_comment(self,line):
15: self._writeline('// '+line)
16:
17: def start_section(self, file, count):
18: data = '#line '+str(count)+' '+'"'+file+'"'
19: self._writeline(data)
20: if self.weaver:
21: self.weaver.echotangle(self.sink.lines_written,data)
22:
23: def get_comment_tangler(self):
24: return cpp_comment_tangler(self.sink, weaver)
25:
26: def get_string_tangler(self,eol,width):
27: return c_string_tangler(self.sink,self.weaver,eol,width)
28:
29: