Remove comments from CDDL content.
(self, content: str)
| 1070 | return self.modules |
| 1071 | |
| 1072 | def _remove_comments(self, content: str) -> str: |
| 1073 | """Remove comments from CDDL content.""" |
| 1074 | # CDDL uses ; for comments to end of line |
| 1075 | lines = content.split("\n") |
| 1076 | cleaned = [] |
| 1077 | for line in lines: |
| 1078 | if ";" in line and not line.strip().startswith(";"): |
| 1079 | line = line[: line.index(";")] |
| 1080 | elif line.strip().startswith(";"): |
| 1081 | continue |
| 1082 | cleaned.append(line) |
| 1083 | return "\n".join(cleaned) |
| 1084 | |
| 1085 | def _extract_definitions(self, content: str) -> None: |
| 1086 | """Extract CDDL definitions (type definitions, commands, etc.).""" |