From patchwork Tue Jan 30 12:06:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 194085 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1183109dyb; Tue, 30 Jan 2024 04:28:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnhw6QkwUn7YqPK9qMe5EunIr3PL487cldtS+gEQh3hlLGo4EDRKCRril0zKoL6HiqHH2X X-Received: by 2002:a25:f414:0:b0:dc2:27ec:acb0 with SMTP id q20-20020a25f414000000b00dc227ecacb0mr4929772ybd.22.1706617718086; Tue, 30 Jan 2024 04:28:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706617718; cv=pass; d=google.com; s=arc-20160816; b=bp3HtTajc+h/1MYgKx9DENfJo57AfuHUf0AsMgXPYWJNT3U1ReJaz4Ts1rBp1lj8TI Nj1BoPTnXVDhDbRjcZ/BfxEXB0A7UmQomPM4F4d89GiAiYI/QaPOREAUdSkZDhji7x1e S6zeFbf7v/fJKOLBywWWtSeDmjGkARpoqbSBP2S/kv3jGFIv5NgZMuuVCUS8XMCeQ3z7 rr+xuNDiLEyvRqAOK5xmg+CHEJddLxDuR66Yt8QMmnDtjzOKnKdBcLCGbC0U6Y6QpAmU FdM7xcbozEmw5xUtAsKOPSwoqgLrc2T/sHzSWjV8vvroWgK0Eq1A7ZqgD1WJvTcBm9/t 85bA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=zAmgzH0sDhe3iFA+EwRaChPi+cFzcmlo8h9H+LYIMVQ=; fh=s1GzlUPo1djGkCl3rkRJI30hDOSCVwGp0RAbVwQ8dxQ=; b=H2x8ly33oMBcigE4bUH4YaerIakMKLzxjcRrBVYDHKn52q0Sc5JzzbsJVyZfHUYMcR w6BCnptFy783O1ZuXadmIBTug3WTy18F75U+w18LopGjZv0IAOORI4zkPSyVdJ12+mNA yYlSZpDctRVsBOplecVi0vxLVdCsLtsjh9MYHNG4cYcL1STb0of6GT4awDHrHv7bIBg2 Ot3j3aJnhCrJwQVClVHROkuo0bZpZaGM9yuRPvWTpOu2/cidbzqPhLi9nvAwn7cdA34Y PxC2FhBKv4g3wksLXywbKdTqbBvQih5a9W5I7v8a0HPDk9bXX7+7Z1DR6yabpGByH4MJ GqOg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=WTQkG6ZU; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ey6-20020a0562140b6600b0068c4d716c46si4956775qvb.60.2024.01.30.04.28.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=WTQkG6ZU; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 869083861832 for ; Tue, 30 Jan 2024 12:28:30 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id 5CA86385801E for ; Tue, 30 Jan 2024 12:11:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5CA86385801E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5CA86385801E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616681; cv=none; b=lv8bQVULhC4/R0uSLs5oJmcxCcjZKRPvMoHhLgDIu/B3NdRJKScpgPdQYtbMlcsajNcvGyzLVR4HwB2BxN+elnFlCFGCifa8Nvmso2ziqA84SfRn5wZ0BcnYZTGJ/hleUELQdgPU0De9nLBK35OWi8wJv/slIX/1U7VWST1DolE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616681; c=relaxed/simple; bh=UghAqn1zcs0WVMjM9MHB+crbvJZ1+qrzhJDy7ZQ5QqE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LAhUMye5teArP2GAc3C2GFkVcv4N9xl1ncx5P/e8Kqu1pLNsBQL6USAzSDeBMQ4CWjd18tGZZgGbmh4vNDyxtu/FgnveNlZNETKEs7F+6BQmcQszXj0mjhxZevf5paKgJ3FxtA2+MWoZ3VBSaof1xBqHw9PwF431SNFoWlW1YS4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5102b00c2cdso3280356e87.3 for ; Tue, 30 Jan 2024 04:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616669; x=1707221469; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=zAmgzH0sDhe3iFA+EwRaChPi+cFzcmlo8h9H+LYIMVQ=; b=WTQkG6ZUKYNytC10xVFr9CmEEXPWkj9CuKNaV8qZrbBAmHcQQ6LaJ3hM4ZIGGisNnC Dwfg2z2bQiInG77bBVTrQxUFjs1fX0tNd5hKHkJ/BJEN6mBQWgA7Y/wlCtbWTukZhH01 PlRA91TII3pO+s6+WNEGavkemnqAUMFa/x9o6KS+oJLOJasQVrmr75JiaTPzcprWFKuj LaEv9EX/iCvdzDq59YmNPq3HTxZoxdv8LT9+zwxZEaAJU5r/KxbPiqDntJAzKZccKri0 VLWtNy3jT3DQI/a4MMxbrUF974z/8On73Nnfz4zy+OtjV3ZuasYU5Auu8fusFb6uFgdW xlGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616669; x=1707221469; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zAmgzH0sDhe3iFA+EwRaChPi+cFzcmlo8h9H+LYIMVQ=; b=RDmkB5DLWEKSO1G62u4KMAWXhirXt5Ny4MoYoxlHkA0Nu/SDGFJVGrPJGMVY2RMjh9 r/IR503a21pa8ejw/kmQEe24E5YQU0YZXTIoJUwKJzp17OMt7totCjjW8t/IzPaqHiVt 7fgTNXZ7hoV2n0beVevbLT5Rej+5pZKK2uCfN/ptbh4qMIa0JPdkmaI30Io7UoOXnSyx p2UZUVvDJ7U0BsP6s9xNwF+AyYouCqEwE2GzqLC6/tbCeQobWut5dHDgiXvvzr53iKJn h2k9v+c2/f6mfz7nI0Q/4fey/f6Pbec40ndzuDqfR3iqknf2qi4A8dQ2syEJWaGBj0U9 wMiA== X-Gm-Message-State: AOJu0YzwUvz7DF0bcrs292xT0XtAI8uzImYpvcpedTrHFSCCT8LLTxRS 8/gGlfcM0pNHbJ+86DLPsFozQ+fSnkXzvIBpgXnytbewatzRkKMifZ6FRIrzKVJQg4Vq5lWzXhJ KQA== X-Received: by 2002:a05:6512:e8f:b0:511:f41:6144 with SMTP id bi15-20020a0565120e8f00b005110f416144mr4988694lfb.61.1706616669163; Tue, 30 Jan 2024 04:11:09 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:08 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [COMMITTED 026/101] gccrs: Treat underscore as a keyword Date: Tue, 30 Jan 2024 13:06:42 +0100 Message-ID: <20240130121026.807464-29-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240130121026.807464-2-arthur.cohen@embecosm.com> References: <20240130121026.807464-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789518380326793782 X-GMAIL-MSGID: 1789518380326793782 From: Pierre-Emmanuel Patry 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 --- gcc/rust/lex/rust-token.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gcc/rust/lex/rust-token.h b/gcc/rust/lex/rust-token.h index df321000511..401452f515c 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") \