Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: mojom/mojom_parser/lexer/tokens.go

Issue 1593543004: Update the mojom lexer to emit comment tokens. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojom/mojom_parser/lexer/token_stream.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojom/mojom_parser/lexer/tokens.go
diff --git a/mojom/mojom_parser/lexer/tokens.go b/mojom/mojom_parser/lexer/tokens.go
index 660a84e574910eeffc5eb2192385520510cbb79a..0083ba2504bcae69106b0b56751e91fce2c77ea6 100644
--- a/mojom/mojom_parser/lexer/tokens.go
+++ b/mojom/mojom_parser/lexer/tokens.go
@@ -67,6 +67,10 @@ const (
FloatConst
Ordinal
StringLiteral
+
+ // Comments
+ SingleLineComment
+ MultiLineComment
)
// This method is used to generate user-facing strings in compilation error
@@ -162,6 +166,11 @@ func (tokenKind TokenKind) String() string {
case StringLiteral:
return "a string literal"
+ case SingleLineComment:
+ return "single line comment"
+ case MultiLineComment:
+ return "multi line comment"
+
default:
// Note(rudominer) It is important to use %d below so as to avoid
// re-invoking this method and causing an infinite recursion.
« no previous file with comments | « mojom/mojom_parser/lexer/token_stream.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698