(self, tkn: Token)
| 76 | self.out.write(txt) |
| 77 | |
| 78 | def emit_multiline_comment(self, tkn: Token) -> None: |
| 79 | self.set_position(tkn) |
| 80 | lines = tkn.text.splitlines(True) |
| 81 | first = True |
| 82 | for line in lines: |
| 83 | text = line.lstrip() |
| 84 | if first: |
| 85 | spaces = 0 |
| 86 | else: |
| 87 | spaces = self.indents[-1] |
| 88 | if text.startswith("*"): |
| 89 | spaces += 1 |
| 90 | else: |
| 91 | spaces += 3 |
| 92 | first = False |
| 93 | self.out.write(" " * spaces) |
| 94 | self.out.write(text) |
| 95 | |
| 96 | def emit_token(self, tkn: Token) -> None: |
| 97 | if tkn.kind == "COMMENT" and "\n" in tkn.text: |
no test coverage detected