Exemple #1
0
	def parse_comment_single(self, i, line):
		grp = "c"
		res = self.reg_comment_s.search(line)
		#print "parsing:", line.rstrip()
		if res:
			dbg_p2(grp,"comment_s: ", res.group())
			self.comment_line[0:]=i, res.start()
			#print "added:", comment_line
			self.is_comment = True
			#print "b4:", line.rstrip()
			#print "b4:", line[res.end():]
			self.parse_comment_multiline(i, line[res.end():])
Exemple #2
0
	def print_comment(self):
		grp = "c"
		dbg_p2(grp,self.comment_line_g)
		for comment in self.comment_line_g:
			if comment[0]==comment[2]:
				## comment on single line
				dbg_p2(grp,\
				  self.game_lines[comment[0]][comment[1]:comment[3]+1])
			else:
				## comments on multiple line
				dbg_p2(grp,self.game_lines[comment[0]][comment[1]:])
				dbg_p2(grp,self.game_lines[comment[2]][:comment[3]+1])