Handle the case where a single-line comment is less than 3 characters long. R=rudominer@chromium.org, rudominer BUG= #592 Review URL: https://codereview.chromium.org/1822233002 .
diff --git a/mojo/public/tools/bindings/mojom_tool/bin/linux64/mojom.sha1 b/mojo/public/tools/bindings/mojom_tool/bin/linux64/mojom.sha1 index f877b06..d8bc4a8 100644 --- a/mojo/public/tools/bindings/mojom_tool/bin/linux64/mojom.sha1 +++ b/mojo/public/tools/bindings/mojom_tool/bin/linux64/mojom.sha1
@@ -1 +1 @@ -4cf9bd6d35321e593c7f020fd7575a6085fb1647 \ No newline at end of file +c40dec5fd197ccd4c933404f8b382587a089afad \ No newline at end of file
diff --git a/mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 b/mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 index d4f2e23..c5bdae1 100644 --- a/mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1 +++ b/mojo/public/tools/bindings/mojom_tool/bin/mac64/mojom.sha1
@@ -1 +1 @@ -18499cedacd5eb9953ecbb41cf0d7a5811289051 \ No newline at end of file +9498acaa38bc428dea6d84e2e45e552dd15ff466 \ No newline at end of file
diff --git a/mojom/mojom_parser/formatter/printer.go b/mojom/mojom_parser/formatter/printer.go index 821defa..6de06c3 100644 --- a/mojom/mojom_parser/formatter/printer.go +++ b/mojom/mojom_parser/formatter/printer.go
@@ -664,8 +664,7 @@ // 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)