| Index: mojom/mojom_parser/formatter/printer.go
|
| diff --git a/mojom/mojom_parser/formatter/printer.go b/mojom/mojom_parser/formatter/printer.go
|
| index 821defa5602180b0a02ea896ba1b065f949929b4..6de06c3c2e80b2fc60eee83fb434b0f5f2de99f5 100644
|
| --- a/mojom/mojom_parser/formatter/printer.go
|
| +++ b/mojom/mojom_parser/formatter/printer.go
|
| @@ -664,8 +664,7 @@ func (p *printer) writeSingleLineComment(comment lexer.Token) {
|
|
|
| // We expect that the first 2 characters are // followed by a space or tab.
|
| // If the third character is not a space or tab, we insert a space.
|
| - space := commentText[2]
|
| - if space != ' ' && space != '\t' {
|
| + if len(commentText) > 2 && commentText[2] != ' ' && commentText[2] != '\t' {
|
| commentText = "// " + commentText[2:]
|
| }
|
| p.write(commentText)
|
|
|