diff options
author | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-02-21 13:49:40 +0100 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2022-02-22 12:06:27 +0100 |
commit | ded1aca9022faa4a72a97f117ace085ecb34487f (patch) | |
tree | 754d0ffcc539e159a04df095e5e6b62312206c39 /gcc/rust/expand/rust-macro-expand.h | |
parent | 143aad62e16ea96e8c562b96857c2497f74ba7c7 (diff) | |
download | gcc-ded1aca9022faa4a72a97f117ace085ecb34487f.zip gcc-ded1aca9022faa4a72a97f117ace085ecb34487f.tar.gz gcc-ded1aca9022faa4a72a97f117ace085ecb34487f.tar.bz2 |
substitute_repetition: Substitute repetitions properly
Diffstat (limited to 'gcc/rust/expand/rust-macro-expand.h')
-rw-r--r-- | gcc/rust/expand/rust-macro-expand.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/rust/expand/rust-macro-expand.h b/gcc/rust/expand/rust-macro-expand.h index 943115d..51e5ad1 100644 --- a/gcc/rust/expand/rust-macro-expand.h +++ b/gcc/rust/expand/rust-macro-expand.h @@ -204,14 +204,16 @@ struct MacroExpander * * @param input Tokens given to the transcribing context * @param fragments Fragments given to the macro substitution - * @param repetition Set of tokens to substitute and replace + * @param pattern_start Start index of the pattern tokens + * @param pattern_end Index Amount of tokens in the pattern * * @return A vector containing the repeated pattern */ static std::vector<std::unique_ptr<AST::Token>> substitute_repetition (std::vector<std::unique_ptr<AST::Token>> &input, + std::vector<std::unique_ptr<AST::Token>> ¯o, std::map<std::string, MatchedFragment> &fragments, - std::vector<std::unique_ptr<AST::Token>> &pattern); + size_t pattern_start, size_t pattern_end); /** * Substitute a given token by its appropriate representation @@ -228,8 +230,8 @@ struct MacroExpander * ahead of the input to avoid mis-substitutions */ static std::pair<std::vector<std::unique_ptr<AST::Token>>, size_t> - substitute_token (std::vector<std::unique_ptr<AST::Token>> ¯o, - std::vector<std::unique_ptr<AST::Token>> &input, + substitute_token (std::vector<std::unique_ptr<AST::Token>> &input, + std::vector<std::unique_ptr<AST::Token>> ¯o, std::map<std::string, MatchedFragment> &fragments, size_t token_idx); |