strip comments in the content
(self, content)
| 56 | return i_path |
| 57 | |
| 58 | def strip(self, content): |
| 59 | """strip comments in the content |
| 60 | """ |
| 61 | content = CFile.m_comment_pat.sub('', content) |
| 62 | # backend/libpq/be-secure.c contains private key with '//' |
| 63 | if 'be-secure' not in self.path and 'guc_gp.c' not in self.path: |
| 64 | content = CFile.s_comment_pat.sub('', content) |
| 65 | content = CFile.attribute_pat.sub('', content) |
| 66 | # .c files included in other .c files can generally not be found from |
| 67 | # where the mock files are located which leads to compilation failure. |
| 68 | # Since we thus far arent interested in handling this anyways, let's |
| 69 | # skip this for now except for the guc special case |
| 70 | if 'guc' not in self.path: |
| 71 | content = CFile.include_c_pat.sub('', content) |
| 72 | return content |
| 73 | |
| 74 | def skip_func_body(self, content, index): |
| 75 | """Skip function body by finding a line starting with a closing brace. |
no outgoing calls