aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-11-16 12:39:37 +0100
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2023-11-21 12:45:32 +0000
commit52a5b5d535231b353d6074e739dcb13073bcd77e (patch)
tree4c42c6e2a873d4011741330d8f62f54c2895ddf1
parent8433e828c0f39dbf9f4bf24203b44cc5407936e0 (diff)
downloadgcc-52a5b5d535231b353d6074e739dcb13073bcd77e.zip
gcc-52a5b5d535231b353d6074e739dcb13073bcd77e.tar.gz
gcc-52a5b5d535231b353d6074e739dcb13073bcd77e.tar.bz2
Treat underscore as a keyword
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 <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--gcc/rust/lex/rust-token.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/rust/lex/rust-token.h b/gcc/rust/lex/rust-token.h
index 826d066..5adf001 100644
--- a/gcc/rust/lex/rust-token.h
+++ b/gcc/rust/lex/rust-token.h
@@ -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 \
@@ -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") \