Skip to content

Commit

Permalink
Treat underscore as a keyword
Browse files Browse the repository at this point in the history
Make the underscore token a 2015 keyword.

gcc/rust/ChangeLog:

	* lex/rust-token.h (enum PrimitiveCoreType): Change macro for
	underscore in token list.

Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
  • Loading branch information
P-E-P committed Nov 16, 2023
1 parent 1da5017 commit 72292cb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions gcc/rust/lex/rust-token.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ enum PrimitiveCoreType
RS_TOKEN (SCOPE_RESOLUTION, "::") /* dodgy */ \
RS_TOKEN (SINGLE_QUOTE, "'") /* should i differentiate from lifetime? */ \
RS_TOKEN (DOUBLE_QUOTE, "\"") \
RS_TOKEN (UNDERSCORE, \
"_") /* TODO: treat as reserved word like mrustc instead? */ \
RS_TOKEN (IDENTIFIER, "identifier") \
RS_TOKEN (INT_LITERAL, \
"integer literal") /* do different int and float types need \
Expand Down Expand Up @@ -194,6 +192,7 @@ enum PrimitiveCoreType
RS_TOKEN_KEYWORD_2015 (TRY, "try") /* unused */ \
RS_TOKEN_KEYWORD_2015 (TYPE, "type") \
RS_TOKEN_KEYWORD_2015 (TYPEOF, "typeof") /* unused */ \
RS_TOKEN_KEYWORD_2015 (UNDERSCORE, "_") \
RS_TOKEN_KEYWORD_2015 (UNSAFE, "unsafe") \
RS_TOKEN_KEYWORD_2015 (UNSIZED, "unsized") /* unused */ \
RS_TOKEN_KEYWORD_2015 (USE, "use") \
Expand Down

0 comments on commit 72292cb

Please sign in to comment.