aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse.h
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-04-05 12:36:41 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2023-04-07 11:36:58 +0000
commite44f127cdb12a28536fe21983dfad20570bceda0 (patch)
treea43962685d333f2efbd03901ebb69761aee75e3a /gcc/rust/parse/rust-parse.h
parent92b137048583c2c22c585097119dba6a5fe06228 (diff)
downloadgcc-e44f127cdb12a28536fe21983dfad20570bceda0.zip
gcc-e44f127cdb12a28536fe21983dfad20570bceda0.tar.gz
gcc-e44f127cdb12a28536fe21983dfad20570bceda0.tar.bz2
ast: Add difference between attributes
Add a boolean to tell inner and outer attributes ast nodes appart. This meant refactoring a bit their parsing function. gcc/rust/ChangeLog: * ast/rust-ast.h: Add boolean for differenciation. * parse/rust-parse-impl.h (Parser::parse_doc_comment): Change function interface to make code cleaner. It should return a body instead of the whole attribute. (Parser::parse_inner_attribute): Specify the inner status of the node. (Parser::parse_attribute_body): Change function interface to make the code cleaner much like parse_doc_comment. (Parser::parse_outer_attribute): Specify outer status of the node. * parse/rust-parse.h: Update functions prototypes. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r--gcc/rust/parse/rust-parse.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 42168e9..6957b66 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -149,7 +149,8 @@ public:
AST::Visibility parse_visibility ();
std::unique_ptr<AST::IdentifierPattern> parse_identifier_pattern ();
std::unique_ptr<AST::TokenTree> parse_token_tree ();
- AST::Attribute parse_attribute_body ();
+ std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, Location>
+ parse_attribute_body ();
AST::AttrVec parse_inner_attributes ();
std::unique_ptr<AST::MacroInvocation>
parse_macro_invocation (AST::AttrVec outer_attrs);
@@ -172,7 +173,8 @@ private:
AST::AttrVec parse_outer_attributes ();
AST::Attribute parse_outer_attribute ();
std::unique_ptr<AST::AttrInput> parse_attr_input ();
- AST::Attribute parse_doc_comment ();
+ std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, Location>
+ parse_doc_comment ();
// Path-related
AST::SimplePath parse_simple_path ();