From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 8350D3858C2C for ; Mon, 27 Sep 2021 22:08:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8350D3858C2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x0a.wildebeest.org [172.31.17.140]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 34D803000A0A; Tue, 28 Sep 2021 00:08:13 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id B23212E82F93; Tue, 28 Sep 2021 00:08:13 +0200 (CEST) From: Mark Wielaard To: gcc-rust@gcc.gnu.org Cc: Mark Wielaard Subject: [PATCH] Remove raw string and raw byte string references from ast and hir Date: Tue, 28 Sep 2021 00:08:01 +0200 Message-Id: <20210927220801.464855-1-mark@klomp.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-rust@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: gcc-rust mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 22:08:18 -0000 Raw strings and raw byte strings are simply different ways to create string and byte string literals. Only the lexer cares how those literals are constructed and which escapes are used to construct them. The parser and hir simply see strings or byte strings. --- https://code.wildebeest.org/git/user/mjw/gccrs/commit/?h=no-raw-byte-string gcc/rust/ast/rust-ast.h | 2 -- gcc/rust/ast/rust-item.h | 2 +- gcc/rust/hir/rust-ast-lower-expr.h | 6 ------ gcc/rust/hir/tree/rust-hir.h | 2 -- gcc/rust/parse/rust-parse-impl.h | 3 --- 5 files changed, 1 insertion(+), 14 deletions(-) diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 96b8da40dd7..b0738a26b6c 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -259,10 +259,8 @@ public: { CHAR, STRING, - RAW_STRING, BYTE, BYTE_STRING, - RAW_BYTE_STRING, INT, FLOAT, BOOL diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 7a34144f0d3..c7c8b8f5692 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -32,7 +32,7 @@ class MacroInvocationSemi; // TODO: inline? /*struct AbiName { std::string abi_name; - // Technically is meant to be STRING_LITERAL or RAW_STRING_LITERAL + // Technically is meant to be STRING_LITERAL public: // Returns whether abi name is empty, i.e. doesn't exist. diff --git a/gcc/rust/hir/rust-ast-lower-expr.h b/gcc/rust/hir/rust-ast-lower-expr.h index ff4c181d0e2..1d0b6cc6977 100644 --- a/gcc/rust/hir/rust-ast-lower-expr.h +++ b/gcc/rust/hir/rust-ast-lower-expr.h @@ -332,18 +332,12 @@ public: case AST::Literal::LitType::STRING: type = HIR::Literal::LitType::STRING; break; - case AST::Literal::LitType::RAW_STRING: - type = HIR::Literal::LitType::RAW_STRING; - break; case AST::Literal::LitType::BYTE: type = HIR::Literal::LitType::BYTE; break; case AST::Literal::LitType::BYTE_STRING: type = HIR::Literal::LitType::BYTE_STRING; break; - case AST::Literal::LitType::RAW_BYTE_STRING: - type = HIR::Literal::LitType::RAW_BYTE_STRING; - break; case AST::Literal::LitType::INT: type = HIR::Literal::LitType::INT; break; diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h index 8ba6308fdea..5a64662efbc 100644 --- a/gcc/rust/hir/tree/rust-hir.h +++ b/gcc/rust/hir/tree/rust-hir.h @@ -45,10 +45,8 @@ public: { CHAR, STRING, - RAW_STRING, BYTE, BYTE_STRING, - RAW_BYTE_STRING, INT, FLOAT, BOOL diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 8cce9332350..c2d3720b47d 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -7556,8 +7556,6 @@ Parser::parse_literal_expr (AST::AttrVec outer_attrs) literal_value = t->get_str (); lexer.skip_token (); break; - // case RAW_STRING_LITERAL: - // put here if lexer changes to have these case BYTE_CHAR_LITERAL: type = AST::Literal::BYTE; literal_value = t->get_str (); @@ -7568,7 +7566,6 @@ Parser::parse_literal_expr (AST::AttrVec outer_attrs) literal_value = t->get_str (); lexer.skip_token (); break; - // case RAW_BYTE_STRING_LITERAL: case INT_LITERAL: type = AST::Literal::INT; literal_value = t->get_str (); -- 2.32.0