Remove comments from CDDL content.
(self, content: str)
| 1080 | return self.modules |
| 1081 | |
| 1082 | def _remove_comments(self, content: str) -> str: |
| 1083 | """Remove comments from CDDL content.""" |
| 1084 | # CDDL uses ; for comments to end of line |
| 1085 | lines = content.split("\n") |
| 1086 | cleaned = [] |
| 1087 | for line in lines: |
| 1088 | if ";" in line and not line.strip().startswith(";"): |
| 1089 | line = line[: line.index(";")] |
| 1090 | elif line.strip().startswith(";"): |
| 1091 | continue |
| 1092 | cleaned.append(line) |
| 1093 | return "\n".join(cleaned) |
| 1094 | |
| 1095 | def _extract_definitions(self, content: str) -> None: |
| 1096 | """Extract CDDL definitions (type definitions, commands, etc.).""" |