diff options
Diffstat (limited to 'gcc/rust/parse/rust-parse.h')
-rw-r--r-- | gcc/rust/parse/rust-parse.h | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h index 4fab60f..8253885 100644 --- a/gcc/rust/parse/rust-parse.h +++ b/gcc/rust/parse/rust-parse.h @@ -34,12 +34,19 @@ class ParseLifetimeParamError class ParseLifetimeError { }; + +enum class AnonConstError +{ + InvalidSizeExpr, +}; + enum class ParseLoopLabelError { NOT_LOOP_LABEL, MISSING_COLON, }; -enum ParseSelfError + +enum class ParseSelfError { SELF_PTR, PARSING, @@ -166,6 +173,8 @@ public: tl::optional<AST::LoopLabel> = tl::nullopt, location_t pratt_parsed_loc = UNKNOWN_LOCATION); + tl::expected<AST::AnonConst, AnonConstError> parse_anon_const (); + std::unique_ptr<AST::ConstBlock> parse_const_block_expr (AST::AttrVec outer_attrs = AST::AttrVec (), location_t loc = UNKNOWN_LOCATION); @@ -227,7 +236,7 @@ private: // Path-related AST::SimplePath parse_simple_path (); - AST::SimplePathSegment parse_simple_path_segment (); + AST::SimplePathSegment parse_simple_path_segment (int base_peek = 0); AST::TypePath parse_type_path (); std::unique_ptr<AST::TypePathSegment> parse_type_path_segment (); AST::PathIdentSegment parse_path_ident_segment (); @@ -649,6 +658,9 @@ private: std::unique_ptr<AST::ReturnExpr> parse_return_expr (AST::AttrVec outer_attrs = AST::AttrVec (), location_t pratt_parsed_loc = UNKNOWN_LOCATION); + std::unique_ptr<AST::TryExpr> + parse_try_expr (AST::AttrVec outer_attrs = AST::AttrVec (), + location_t pratt_parsed_loc = UNKNOWN_LOCATION); std::unique_ptr<AST::BreakExpr> parse_break_expr (AST::AttrVec outer_attrs = AST::AttrVec (), location_t pratt_parsed_loc = UNKNOWN_LOCATION); @@ -767,6 +779,10 @@ private: } ~InlineModuleStackScope () { parser.inline_module_stack.pop_back (); } }; + + // don't want to make things *only* AttributeParser uses public + // TODO: fold more of AttributeParser into Parser? + friend class ::Rust::AST::AttributeParser; }; std::string extract_module_path (const AST::AttrVec &inner_attrs, @@ -785,7 +801,4 @@ bool is_match_compatible (const AST::MacroMatch &last_match, const AST::MacroMatch ¤t_match); } // namespace Rust -// as now template, include implementations of all methods -#include "rust-parse-impl.h" - #endif // RUST_PARSE_H |