// TODO: Create new `make_qualified_call` helper function
-DeriveClone::DeriveClone (Location loc)
+DeriveClone::DeriveClone (location_t loc)
: DeriveVisitor (loc), expanded (nullptr)
{}
class DeriveClone : DeriveVisitor
{
public:
- DeriveClone (Location loc);
+ DeriveClone (location_t loc);
std::unique_ptr<AST::Item> go (Item &item);
namespace Rust {
namespace AST {
-DeriveCopy::DeriveCopy (Location loc) : DeriveVisitor (loc), expanded (nullptr)
+DeriveCopy::DeriveCopy (location_t loc)
+ : DeriveVisitor (loc), expanded (nullptr)
{}
std::unique_ptr<AST::Item>
class DeriveCopy : DeriveVisitor
{
public:
- DeriveCopy (Location loc);
+ DeriveCopy (location_t loc);
std::unique_ptr<Item> go (Item &);
namespace Rust {
namespace AST {
-DeriveVisitor::DeriveVisitor (Location loc)
+DeriveVisitor::DeriveVisitor (location_t loc)
: loc (loc), builder (AstBuilder (loc))
{}
BuiltinMacro to_derive);
protected:
- DeriveVisitor (Location loc);
+ DeriveVisitor (location_t loc);
- Location loc;
+ location_t loc;
AstBuilder builder;
private:
}};
std::unordered_map<
- std::string, std::function<AST::Fragment (Location, AST::MacroInvocData &)>>
+ std::string, std::function<AST::Fragment (location_t, AST::MacroInvocData &)>>
MacroBuiltin::builtin_transcribers = {
{"assert", MacroBuiltin::assert_handler},
{"file", MacroBuiltin::file_handler},
/* Expand and then extract a string literal from the macro */
static std::unique_ptr<AST::LiteralExpr>
-try_extract_string_literal_from_fragment (const Location &parent_locus,
+try_extract_string_literal_from_fragment (const location_t &parent_locus,
std::unique_ptr<AST::Expr> &node)
{
auto maybe_lit = static_cast<AST::LiteralExpr *> (node.get ());
std::unique_ptr<AST::Expr>
parse_single_string_literal (BuiltinMacro kind,
AST::DelimTokenTree &invoc_token_tree,
- Location invoc_locus, MacroExpander *expander)
+ location_t invoc_locus, MacroExpander *expander)
{
MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
Parser<MacroInvocLexer> parser (lex);
FIXME: platform specific. */
std::vector<uint8_t>
-load_file_bytes (Location invoc_locus, const char *filename)
+load_file_bytes (location_t invoc_locus, const char *filename)
{
RAIIFile file_wrap (filename);
if (file_wrap.get_raw () == nullptr)
} // namespace
AST::Fragment
-MacroBuiltin::assert_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::assert_handler (location_t invoc_locus,
+ AST::MacroInvocData &invoc)
{
rust_debug ("assert!() called");
}
AST::Fragment
-MacroBuiltin::file_handler (Location invoc_locus, AST::MacroInvocData &)
+MacroBuiltin::file_handler (location_t invoc_locus, AST::MacroInvocData &)
{
auto current_file = LOCATION_FILE (invoc_locus);
auto file_str = AST::SingleASTNode (make_string (invoc_locus, current_file));
}
AST::Fragment
-MacroBuiltin::column_handler (Location invoc_locus, AST::MacroInvocData &)
+MacroBuiltin::column_handler (location_t invoc_locus, AST::MacroInvocData &)
{
auto current_column = LOCATION_COLUMN (invoc_locus);
&'static [u8; N]. */
AST::Fragment
-MacroBuiltin::include_bytes_handler (Location invoc_locus,
+MacroBuiltin::include_bytes_handler (location_t invoc_locus,
AST::MacroInvocData &invoc)
{
/* Get target filename from the macro invocation, which is treated as a path
expression of type &'static str. */
AST::Fragment
-MacroBuiltin::include_str_handler (Location invoc_locus,
+MacroBuiltin::include_str_handler (location_t invoc_locus,
AST::MacroInvocData &invoc)
{
/* Get target filename from the macro invocation, which is treated as a path
/* Expand builtin macro compile_error!("error"), which forces a compile error
during the compile time. */
AST::Fragment
-MacroBuiltin::compile_error_handler (Location invoc_locus,
+MacroBuiltin::compile_error_handler (location_t invoc_locus,
AST::MacroInvocData &invoc)
{
auto lit_expr
// Do we split the two passes of parsing the token tree and then expanding it?
// Can we do that easily?
AST::Fragment
-MacroBuiltin::concat_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::concat_handler (location_t invoc_locus,
+ AST::MacroInvocData &invoc)
{
auto invoc_token_tree = invoc.get_delim_tok_tree ();
MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
/* Expand builtin macro env!(), which inspects an environment variable at
compile time. */
AST::Fragment
-MacroBuiltin::env_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::env_handler (location_t invoc_locus, AST::MacroInvocData &invoc)
{
auto invoc_token_tree = invoc.get_delim_tok_tree ();
MacroInvocLexer lex (invoc_token_tree.to_token_stream ());
}
AST::Fragment
-MacroBuiltin::cfg_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::cfg_handler (location_t invoc_locus, AST::MacroInvocData &invoc)
{
// only parse if not already parsed
if (!invoc.is_parsed ())
scope compile time. */
AST::Fragment
-MacroBuiltin::include_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::include_handler (location_t invoc_locus,
+ AST::MacroInvocData &invoc)
{
/* Get target filename from the macro invocation, which is treated as a path
relative to the include!-ing file (currently being compiled). */
}
AST::Fragment
-MacroBuiltin::line_handler (Location invoc_locus, AST::MacroInvocData &)
+MacroBuiltin::line_handler (location_t invoc_locus, AST::MacroInvocData &)
{
auto current_line = LOCATION_LINE (invoc_locus);
}
AST::Fragment
-MacroBuiltin::stringify_handler (Location invoc_locus,
+MacroBuiltin::stringify_handler (location_t invoc_locus,
AST::MacroInvocData &invoc)
{
std::string content;
}
AST::Fragment
-MacroBuiltin::sorry (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::sorry (location_t invoc_locus, AST::MacroInvocData &invoc)
{
rust_sorry_at (invoc_locus, "unimplemented builtin macro: %qs",
invoc.get_path ().as_string ().c_str ());
}
AST::Fragment
-MacroBuiltin::proc_macro_builtin (Location invoc_locus,
+MacroBuiltin::proc_macro_builtin (location_t invoc_locus,
AST::MacroInvocData &invoc)
{
rust_error_at (invoc_locus, "cannot invoke derive macro: %qs",
{
public:
static const BiMap<std::string, BuiltinMacro> builtins;
- static std::unordered_map<
- std::string, std::function<AST::Fragment (Location, AST::MacroInvocData &)>>
+ static std::unordered_map<std::string, std::function<AST::Fragment (
+ location_t, AST::MacroInvocData &)>>
builtin_transcribers;
- static AST::Fragment assert_handler (Location invoc_locus,
+ static AST::Fragment assert_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment file_handler (Location invoc_locus,
+ static AST::Fragment file_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment column_handler (Location invoc_locus,
+ static AST::Fragment column_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment include_bytes_handler (Location invoc_locus,
+ static AST::Fragment include_bytes_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment include_str_handler (Location invoc_locus,
+ static AST::Fragment include_str_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment stringify_handler (Location invoc_locus,
+ static AST::Fragment stringify_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment compile_error_handler (Location invoc_locus,
+ static AST::Fragment compile_error_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment concat_handler (Location invoc_locus,
+ static AST::Fragment concat_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment env_handler (Location invoc_locus,
+ static AST::Fragment env_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment cfg_handler (Location invoc_locus,
+ static AST::Fragment cfg_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment include_handler (Location invoc_locus,
+ static AST::Fragment include_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment line_handler (Location invoc_locus,
+ static AST::Fragment line_handler (location_t invoc_locus,
AST::MacroInvocData &invoc);
- static AST::Fragment sorry (Location invoc_locus, AST::MacroInvocData &invoc);
+ static AST::Fragment sorry (location_t invoc_locus,
+ AST::MacroInvocData &invoc);
/* Builtin procedural macros do not work directly on tokens, but still need a
* builtin transcriber to be considered proper builtin macros */
- static AST::Fragment proc_macro_builtin (Location, AST::MacroInvocData &);
+ static AST::Fragment proc_macro_builtin (location_t, AST::MacroInvocData &);
};
} // namespace Rust
namespace Rust {
AST::Fragment
-MacroExpander::expand_decl_macro (Location invoc_locus,
+MacroExpander::expand_decl_macro (location_t invoc_locus,
AST::MacroInvocData &invoc,
AST::MacroRulesDefinition &rules_def,
bool semicolon)
// Parse a inner or outer doc comment into an doc attribute
template <typename ManagedTokenSource>
-std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, Location>
+std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, location_t>
Parser<ManagedTokenSource>::parse_doc_comment ()
{
const_TokenPtr token = lexer.peek_token ();
// Parses the body of an attribute (inner or outer).
template <typename ManagedTokenSource>
-std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, Location>
+std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, location_t>
Parser<ManagedTokenSource>::parse_attribute_body ()
{
location_t locus = lexer.peek_token ()->get_locus ();
{
const_TokenPtr t = lexer.peek_token ();
lexer.skip_token ();
- Location initial_loc = t->get_locus ();
+ location_t initial_loc = t->get_locus ();
// save delim type to ensure it is reused later
AST::DelimType delim_type = AST::PARENS;
return nullptr;
}
lexer.skip_token ();
- Location macro_locus = t->get_locus ();
+ location_t macro_locus = t->get_locus ();
if (!skip_token (EXCLAM))
{
return nullptr;
}
lexer.skip_token ();
- Location macro_locus = t->get_locus ();
+ location_t macro_locus = t->get_locus ();
// parse macro name
const_TokenPtr ident_tok = expect_token (IDENTIFIER);
return nullptr;
}
- Location transcriber_loc = lexer.peek_token ()->get_locus ();
+ location_t transcriber_loc = lexer.peek_token ()->get_locus ();
AST::DelimTokenTree delim_tok_tree = parse_delim_token_tree ();
AST::MacroTranscriber transcriber (delim_tok_tree, transcriber_loc);
Parser<ManagedTokenSource>::parse_macro_invocation_semi (
AST::AttrVec outer_attrs)
{
- Location macro_locus = lexer.peek_token ()->get_locus ();
+ location_t macro_locus = lexer.peek_token ()->get_locus ();
AST::SimplePath path = parse_simple_path ();
if (!skip_token (EXCLAM))
return nullptr;
}
- Location tok_tree_locus = t->get_locus ();
+ location_t tok_tree_locus = t->get_locus ();
lexer.skip_token ();
// parse actual token trees
// parse internal delim token tree
AST::DelimTokenTree delim_tok_tree = parse_delim_token_tree ();
- Location macro_locus = macro_path.get_locus ();
+ location_t macro_locus = macro_path.get_locus ();
return AST::MacroInvocation::Regular (
AST::MacroInvocData (std::move (macro_path), std::move (delim_tok_tree)),
}
// parse transcriber (this is just a delim token tree)
- Location token_tree_loc = lexer.peek_token ()->get_locus ();
+ location_t token_tree_loc = lexer.peek_token ()->get_locus ();
AST::MacroTranscriber transcriber (parse_delim_token_tree (), token_tree_loc);
return AST::MacroRule (std::move (matcher), std::move (transcriber), locus);
std::unique_ptr<AST::MacroMatchFragment>
Parser<ManagedTokenSource>::parse_macro_match_fragment ()
{
- Location fragment_locus = lexer.peek_token ()->get_locus ();
+ location_t fragment_locus = lexer.peek_token ()->get_locus ();
skip_token (DOLLAR_SIGN);
Identifier ident;
std::string name;
const_TokenPtr t = lexer.peek_token ();
- Location name_location = t->get_locus ();
+ location_t name_location = t->get_locus ();
switch (t->get_id ())
{
case IDENTIFIER:
// Parses a function call representation inside a type path.
template <typename ManagedTokenSource>
AST::TypePathFunction
-Parser<ManagedTokenSource>::parse_type_path_function (Location id_location)
+Parser<ManagedTokenSource>::parse_type_path_function (location_t id_location)
{
if (!skip_token (LEFT_PAREN))
{
template <typename ManagedTokenSource>
AST::QualifiedPathInExpression
Parser<ManagedTokenSource>::parse_qualified_path_in_expression (
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
/* Note: the Rust grammar is defined in such a way that it is impossible to
* determine whether a prospective qualified path is a
template <typename ManagedTokenSource>
AST::QualifiedPathType
Parser<ManagedTokenSource>::parse_qualified_path_type (
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
/* TODO: should this actually be error? is there anywhere where this could
template <typename ManagedTokenSource>
std::unique_ptr<AST::BlockExpr>
Parser<ManagedTokenSource>::parse_block_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
}
}
- Location end_locus = t->get_locus ();
+ location_t end_locus = t->get_locus ();
if (!skip_token (RIGHT_CURLY))
{
template <typename ManagedTokenSource>
std::unique_ptr<AST::ReturnExpr>
Parser<ManagedTokenSource>::parse_return_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
template <typename ManagedTokenSource>
std::unique_ptr<AST::BreakExpr>
Parser<ManagedTokenSource>::parse_break_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
template <typename ManagedTokenSource>
std::unique_ptr<AST::ContinueExpr>
Parser<ManagedTokenSource>::parse_continue_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
template <typename ManagedTokenSource>
std::unique_ptr<AST::IfExpr>
Parser<ManagedTokenSource>::parse_if_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
// TODO: make having outer attributes an error?
location_t locus = pratt_parsed_loc;
template <typename ManagedTokenSource>
std::unique_ptr<AST::IfLetExpr>
Parser<ManagedTokenSource>::parse_if_let_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
// TODO: make having outer attributes an error?
location_t locus = pratt_parsed_loc;
std::unique_ptr<AST::LoopExpr>
Parser<ManagedTokenSource>::parse_loop_expr (AST::AttrVec outer_attrs,
AST::LoopLabel label,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
std::unique_ptr<AST::WhileLoopExpr>
Parser<ManagedTokenSource>::parse_while_loop_expr (AST::AttrVec outer_attrs,
AST::LoopLabel label,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
template <typename ManagedTokenSource>
std::unique_ptr<AST::MatchExpr>
Parser<ManagedTokenSource>::parse_match_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
// Parses an unsafe block expression.
template <typename ManagedTokenSource>
std::unique_ptr<AST::UnsafeBlockExpr>
-Parser<ManagedTokenSource>::parse_unsafe_block_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+Parser<ManagedTokenSource>::parse_unsafe_block_expr (
+ AST::AttrVec outer_attrs, location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
template <typename ManagedTokenSource>
std::unique_ptr<AST::ArrayExpr>
Parser<ManagedTokenSource>::parse_array_expr (AST::AttrVec outer_attrs,
- Location pratt_parsed_loc)
+ location_t pratt_parsed_loc)
{
location_t locus = pratt_parsed_loc;
if (locus == UNKNOWN_LOCATION)
}
}
- Location loc = pattern->get_locus ();
+ location_t loc = pattern->get_locus ();
return AST::ClosureParam (std::move (pattern), loc, std::move (type),
std::move (outer_attrs));
}
template <typename ManagedTokenSource>
std::unique_ptr<AST::ExprWithoutBlock>
Parser<ManagedTokenSource>::parse_grouped_or_tuple_expr (
- AST::AttrVec outer_attrs, Location pratt_parsed_loc)
+ AST::AttrVec outer_attrs, location_t pratt_parsed_loc)
{
// adjustment to allow Pratt parsing to reuse function without copy-paste
location_t locus = pratt_parsed_loc;
* virtual method abuse, as it was copied from the rustc implementation (in
* which types are reified due to tagged union), after a more OOP attempt by
* me failed. */
- Location left_delim_locus = lexer.peek_token ()->get_locus ();
+ location_t left_delim_locus = lexer.peek_token ()->get_locus ();
// skip left delim
lexer.skip_token ();
std::unique_ptr<AST::Type>
Parser<ManagedTokenSource>::parse_for_prefixed_type ()
{
- Location for_locus = lexer.peek_token ()->get_locus ();
+ location_t for_locus = lexer.peek_token ()->get_locus ();
// parse for lifetimes in type
std::vector<AST::LifetimeParam> for_lifetimes = parse_for_lifetimes ();
std::vector<AST::LifetimeParam> for_lifetimes)
{
// TODO: pass in for lifetime location as param
- Location best_try_locus = lexer.peek_token ()->get_locus ();
+ location_t best_try_locus = lexer.peek_token ()->get_locus ();
AST::FunctionQualifiers qualifiers = parse_function_qualifiers ();
* considered a trait bound, not a parenthesised type, so that it can still
* be used in type param bounds. */
- Location left_paren_locus = lexer.peek_token ()->get_locus ();
+ location_t left_paren_locus = lexer.peek_token ()->get_locus ();
// skip left delim
lexer.skip_token ();
Parser<ManagedTokenSource>::parse_range_pattern_bound ()
{
const_TokenPtr range_lower = lexer.peek_token ();
- Location range_lower_locus = range_lower->get_locus ();
+ location_t range_lower_locus = range_lower->get_locus ();
// get lit type
switch (range_lower->get_id ())
std::unique_ptr<AST::Pattern>
Parser<ManagedTokenSource>::parse_pattern ()
{
- Location start_locus = lexer.peek_token ()->get_locus ();
+ location_t start_locus = lexer.peek_token ()->get_locus ();
/* skip optional starting pipe */
maybe_skip_token (PIPE);
std::unique_ptr<AST::Pattern>
Parser<ManagedTokenSource>::parse_grouped_or_tuple_pattern ()
{
- Location paren_locus = lexer.peek_token ()->get_locus ();
+ location_t paren_locus = lexer.peek_token ()->get_locus ();
skip_token (LEFT_PAREN);
// detect '..' token (ranged with no lower range)
std::unique_ptr<AST::SlicePattern>
Parser<ManagedTokenSource>::parse_slice_pattern ()
{
- Location square_locus = lexer.peek_token ()->get_locus ();
+ location_t square_locus = lexer.peek_token ()->get_locus ();
std::vector<std::unique_ptr<AST::Pattern>> patterns;
skip_token (LEFT_SQUARE);
{
// FIXME: allow for outer attributes to be applied
case QUESTION_MARK: {
- Location left_locus = left->get_locus ();
+ location_t left_locus = left->get_locus ();
// error propagation expression - unary postfix
return std::unique_ptr<AST::ErrorPropagationExpr> (
new AST::ErrorPropagationExpr (std::move (left),
rust_debug ("successfully parsed macro invocation (via partial)");
- Location macro_locus = converted_path.get_locus ();
+ location_t macro_locus = converted_path.get_locus ();
return AST::MacroInvocation::Regular (
AST::MacroInvocData (std::move (converted_path), std::move (tok_tree)),
// branch based on next token
const_TokenPtr t = lexer.peek_token ();
- Location path_locus = path.get_locus ();
+ location_t path_locus = path.get_locus ();
switch (t->get_id ())
{
case RIGHT_CURLY:
AST::StructBase struct_base = AST::StructBase::error ();
if (lexer.peek_token ()->get_id () == DOT_DOT)
{
- Location dot_dot_location = lexer.peek_token ()->get_locus ();
+ location_t dot_dot_location = lexer.peek_token ()->get_locus ();
lexer.skip_token ();
// parse required struct base expr
return nullptr;
}
- Location path_locus = path.get_locus ();
+ location_t path_locus = path.get_locus ();
auto pathExpr = std::unique_ptr<AST::PathInExpression> (
new AST::PathInExpression (std::move (path)));
static bool
peculiar_fragment_match_compatible_fragment (
const AST::MacroFragSpec &last_spec, const AST::MacroFragSpec &spec,
- Location match_locus)
+ location_t match_locus)
{
static std::unordered_map<AST::MacroFragSpec::Kind,
std::vector<AST::MacroFragSpec::Kind>>
WHILE,
YIELD}}};
- Location error_locus = match.get_match_locus ();
+ location_t error_locus = match.get_match_locus ();
std::string kind_str = "fragment";
auto &allowed_toks = follow_set[last_match.get_frag_spec ().get_kind ()];
std::unique_ptr<AST::BlockExpr>
parse_block_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::Item> parse_item (bool called_from_statement);
std::unique_ptr<AST::Pattern> parse_pattern ();
std::unique_ptr<AST::IdentifierPattern> parse_identifier_pattern ();
std::unique_ptr<AST::Token> parse_identifier_or_keyword_token ();
std::unique_ptr<AST::TokenTree> parse_token_tree ();
- std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, Location>
+ std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, location_t>
parse_attribute_body ();
AST::AttrVec parse_inner_attributes ();
std::unique_ptr<AST::MacroInvocation>
AST::AttrVec parse_outer_attributes ();
AST::Attribute parse_outer_attribute ();
std::unique_ptr<AST::AttrInput> parse_attr_input ();
- std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, Location>
+ std::tuple<AST::SimplePath, std::unique_ptr<AST::AttrInput>, location_t>
parse_doc_comment ();
// Path-related
// When given a pratt_parsed_loc, use it as the location of the
// first token parsed in the expression (the parsing of that first
// token should be skipped).
- parse_qualified_path_in_expression (Location pratt_parsed_loc
+ parse_qualified_path_in_expression (location_t pratt_parsed_loc
= UNKNOWN_LOCATION);
- AST::QualifiedPathType parse_qualified_path_type (Location pratt_parsed_loc
+ AST::QualifiedPathType parse_qualified_path_type (location_t pratt_parsed_loc
= UNKNOWN_LOCATION);
AST::QualifiedPathInType parse_qualified_path_in_type ();
// token should be skipped).
std::unique_ptr<AST::IfExpr>
parse_if_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::IfLetExpr>
parse_if_let_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::LoopExpr>
parse_loop_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
AST::LoopLabel label = AST::LoopLabel::error (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::WhileLoopExpr>
parse_while_loop_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
AST::LoopLabel label = AST::LoopLabel::error (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::WhileLetLoopExpr>
parse_while_let_loop_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
AST::LoopLabel label = AST::LoopLabel::error ());
AST::LoopLabel label = AST::LoopLabel::error ());
std::unique_ptr<AST::MatchExpr>
parse_match_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
AST::MatchArm parse_match_arm ();
std::vector<std::unique_ptr<AST::Pattern> >
parse_match_arm_patterns (TokenId end_token_id);
// token should be skipped).
std::unique_ptr<AST::ReturnExpr>
parse_return_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::BreakExpr>
parse_break_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::ContinueExpr>
parse_continue_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::UnsafeBlockExpr>
parse_unsafe_block_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::ArrayExpr>
parse_array_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::ExprWithoutBlock>
parse_grouped_or_tuple_expr (AST::AttrVec outer_attrs = AST::AttrVec (),
- Location pratt_parsed_loc = UNKNOWN_LOCATION);
+ location_t pratt_parsed_loc = UNKNOWN_LOCATION);
std::unique_ptr<AST::StructExprField> parse_struct_expr_field ();
bool will_be_expr_with_block ();