rustc_ast: Harmonize delimiter naming with proc_macro::Delimiter
This commit is contained in:
parent
f300792f9a
commit
70067e31ed
@ -2,7 +2,7 @@ use std::borrow::Cow;
|
|||||||
use std::cmp::min;
|
use std::cmp::min;
|
||||||
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use rustc_ast::token::{DelimToken, LitKind};
|
use rustc_ast::token::{Delimiter, LitKind};
|
||||||
use rustc_ast::{ast, ptr};
|
use rustc_ast::{ast, ptr};
|
||||||
use rustc_span::{BytePos, Span};
|
use rustc_span::{BytePos, Span};
|
||||||
|
|
||||||
@ -412,7 +412,7 @@ pub(crate) fn rewrite_array<'a, T: 'a + IntoOverflowableItem<'a>>(
|
|||||||
context: &'a RewriteContext<'_>,
|
context: &'a RewriteContext<'_>,
|
||||||
shape: Shape,
|
shape: Shape,
|
||||||
force_separator_tactic: Option<SeparatorTactic>,
|
force_separator_tactic: Option<SeparatorTactic>,
|
||||||
delim_token: Option<DelimToken>,
|
delim_token: Option<Delimiter>,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
overflow::rewrite_with_square_brackets(
|
overflow::rewrite_with_square_brackets(
|
||||||
context,
|
context,
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::panic::{catch_unwind, AssertUnwindSafe};
|
use std::panic::{catch_unwind, AssertUnwindSafe};
|
||||||
|
|
||||||
use rustc_ast::token::{BinOpToken, DelimToken, Token, TokenKind};
|
use rustc_ast::token::{BinOpToken, Delimiter, Token, TokenKind};
|
||||||
use rustc_ast::tokenstream::{Cursor, Spacing, TokenStream, TokenTree};
|
use rustc_ast::tokenstream::{Cursor, Spacing, TokenStream, TokenTree};
|
||||||
use rustc_ast::{ast, ptr};
|
use rustc_ast::{ast, ptr};
|
||||||
use rustc_ast_pretty::pprust;
|
use rustc_ast_pretty::pprust;
|
||||||
@ -203,7 +203,7 @@ fn rewrite_macro_inner(
|
|||||||
let is_forced_bracket = FORCED_BRACKET_MACROS.contains(&¯o_name[..]);
|
let is_forced_bracket = FORCED_BRACKET_MACROS.contains(&¯o_name[..]);
|
||||||
|
|
||||||
let style = if is_forced_bracket && !is_nested_macro {
|
let style = if is_forced_bracket && !is_nested_macro {
|
||||||
DelimToken::Bracket
|
Delimiter::Bracket
|
||||||
} else {
|
} else {
|
||||||
original_style
|
original_style
|
||||||
};
|
};
|
||||||
@ -212,15 +212,15 @@ fn rewrite_macro_inner(
|
|||||||
let has_comment = contains_comment(context.snippet(mac.span()));
|
let has_comment = contains_comment(context.snippet(mac.span()));
|
||||||
if ts.is_empty() && !has_comment {
|
if ts.is_empty() && !has_comment {
|
||||||
return match style {
|
return match style {
|
||||||
DelimToken::Paren if position == MacroPosition::Item => {
|
Delimiter::Parenthesis if position == MacroPosition::Item => {
|
||||||
Some(format!("{}();", macro_name))
|
Some(format!("{}();", macro_name))
|
||||||
}
|
}
|
||||||
DelimToken::Bracket if position == MacroPosition::Item => {
|
Delimiter::Bracket if position == MacroPosition::Item => {
|
||||||
Some(format!("{}[];", macro_name))
|
Some(format!("{}[];", macro_name))
|
||||||
}
|
}
|
||||||
DelimToken::Paren => Some(format!("{}()", macro_name)),
|
Delimiter::Parenthesis => Some(format!("{}()", macro_name)),
|
||||||
DelimToken::Bracket => Some(format!("{}[]", macro_name)),
|
Delimiter::Bracket => Some(format!("{}[]", macro_name)),
|
||||||
DelimToken::Brace => Some(format!("{} {{}}", macro_name)),
|
Delimiter::Brace => Some(format!("{} {{}}", macro_name)),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ fn rewrite_macro_inner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
match style {
|
match style {
|
||||||
DelimToken::Paren => {
|
Delimiter::Parenthesis => {
|
||||||
// Handle special case: `vec!(expr; expr)`
|
// Handle special case: `vec!(expr; expr)`
|
||||||
if vec_with_semi {
|
if vec_with_semi {
|
||||||
handle_vec_semi(context, shape, arg_vec, macro_name, style)
|
handle_vec_semi(context, shape, arg_vec, macro_name, style)
|
||||||
@ -286,7 +286,7 @@ fn rewrite_macro_inner(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelimToken::Bracket => {
|
Delimiter::Bracket => {
|
||||||
// Handle special case: `vec![expr; expr]`
|
// Handle special case: `vec![expr; expr]`
|
||||||
if vec_with_semi {
|
if vec_with_semi {
|
||||||
handle_vec_semi(context, shape, arg_vec, macro_name, style)
|
handle_vec_semi(context, shape, arg_vec, macro_name, style)
|
||||||
@ -323,7 +323,7 @@ fn rewrite_macro_inner(
|
|||||||
Some(format!("{}{}", rewrite, comma))
|
Some(format!("{}{}", rewrite, comma))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelimToken::Brace => {
|
Delimiter::Brace => {
|
||||||
// For macro invocations with braces, always put a space between
|
// For macro invocations with braces, always put a space between
|
||||||
// the `macro_name!` and `{ /* macro_body */ }` but skip modifying
|
// the `macro_name!` and `{ /* macro_body */ }` but skip modifying
|
||||||
// anything in between the braces (for now).
|
// anything in between the braces (for now).
|
||||||
@ -342,11 +342,11 @@ fn handle_vec_semi(
|
|||||||
shape: Shape,
|
shape: Shape,
|
||||||
arg_vec: Vec<MacroArg>,
|
arg_vec: Vec<MacroArg>,
|
||||||
macro_name: String,
|
macro_name: String,
|
||||||
delim_token: DelimToken,
|
delim_token: Delimiter,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
let (left, right) = match delim_token {
|
let (left, right) = match delim_token {
|
||||||
DelimToken::Paren => ("(", ")"),
|
Delimiter::Parenthesis => ("(", ")"),
|
||||||
DelimToken::Bracket => ("[", "]"),
|
Delimiter::Bracket => ("[", "]"),
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ enum MacroArgKind {
|
|||||||
/// e.g., `$($foo: expr),*`
|
/// e.g., `$($foo: expr),*`
|
||||||
Repeat(
|
Repeat(
|
||||||
/// `()`, `[]` or `{}`.
|
/// `()`, `[]` or `{}`.
|
||||||
DelimToken,
|
Delimiter,
|
||||||
/// Inner arguments inside delimiters.
|
/// Inner arguments inside delimiters.
|
||||||
Vec<ParsedMacroArg>,
|
Vec<ParsedMacroArg>,
|
||||||
/// Something after the closing delimiter and the repeat token, if available.
|
/// Something after the closing delimiter and the repeat token, if available.
|
||||||
@ -537,7 +537,7 @@ enum MacroArgKind {
|
|||||||
Token,
|
Token,
|
||||||
),
|
),
|
||||||
/// e.g., `[derive(Debug)]`
|
/// e.g., `[derive(Debug)]`
|
||||||
Delimited(DelimToken, Vec<ParsedMacroArg>),
|
Delimited(Delimiter, Vec<ParsedMacroArg>),
|
||||||
/// A possible separator. e.g., `,` or `;`.
|
/// A possible separator. e.g., `,` or `;`.
|
||||||
Separator(String, String),
|
Separator(String, String),
|
||||||
/// Other random stuff that does not fit to other kinds.
|
/// Other random stuff that does not fit to other kinds.
|
||||||
@ -547,22 +547,22 @@ enum MacroArgKind {
|
|||||||
|
|
||||||
fn delim_token_to_str(
|
fn delim_token_to_str(
|
||||||
context: &RewriteContext<'_>,
|
context: &RewriteContext<'_>,
|
||||||
delim_token: DelimToken,
|
delim_token: Delimiter,
|
||||||
shape: Shape,
|
shape: Shape,
|
||||||
use_multiple_lines: bool,
|
use_multiple_lines: bool,
|
||||||
inner_is_empty: bool,
|
inner_is_empty: bool,
|
||||||
) -> (String, String) {
|
) -> (String, String) {
|
||||||
let (lhs, rhs) = match delim_token {
|
let (lhs, rhs) = match delim_token {
|
||||||
DelimToken::Paren => ("(", ")"),
|
Delimiter::Parenthesis => ("(", ")"),
|
||||||
DelimToken::Bracket => ("[", "]"),
|
Delimiter::Bracket => ("[", "]"),
|
||||||
DelimToken::Brace => {
|
Delimiter::Brace => {
|
||||||
if inner_is_empty || use_multiple_lines {
|
if inner_is_empty || use_multiple_lines {
|
||||||
("{", "}")
|
("{", "}")
|
||||||
} else {
|
} else {
|
||||||
("{ ", " }")
|
("{ ", " }")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DelimToken::NoDelim => unreachable!(),
|
Delimiter::Invisible => unreachable!(),
|
||||||
};
|
};
|
||||||
if use_multiple_lines {
|
if use_multiple_lines {
|
||||||
let indent_str = shape.indent.to_string_with_newline(context.config);
|
let indent_str = shape.indent.to_string_with_newline(context.config);
|
||||||
@ -583,8 +583,8 @@ impl MacroArgKind {
|
|||||||
fn starts_with_brace(&self) -> bool {
|
fn starts_with_brace(&self) -> bool {
|
||||||
matches!(
|
matches!(
|
||||||
*self,
|
*self,
|
||||||
MacroArgKind::Repeat(DelimToken::Brace, _, _, _)
|
MacroArgKind::Repeat(Delimiter::Brace, _, _, _)
|
||||||
| MacroArgKind::Delimited(DelimToken::Brace, _)
|
| MacroArgKind::Delimited(Delimiter::Brace, _)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -753,7 +753,7 @@ impl MacroArgParser {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn add_delimited(&mut self, inner: Vec<ParsedMacroArg>, delim: DelimToken) {
|
fn add_delimited(&mut self, inner: Vec<ParsedMacroArg>, delim: Delimiter) {
|
||||||
self.result.push(ParsedMacroArg {
|
self.result.push(ParsedMacroArg {
|
||||||
kind: MacroArgKind::Delimited(delim, inner),
|
kind: MacroArgKind::Delimited(delim, inner),
|
||||||
});
|
});
|
||||||
@ -763,7 +763,7 @@ impl MacroArgParser {
|
|||||||
fn add_repeat(
|
fn add_repeat(
|
||||||
&mut self,
|
&mut self,
|
||||||
inner: Vec<ParsedMacroArg>,
|
inner: Vec<ParsedMacroArg>,
|
||||||
delim: DelimToken,
|
delim: Delimiter,
|
||||||
iter: &mut Cursor,
|
iter: &mut Cursor,
|
||||||
) -> Option<()> {
|
) -> Option<()> {
|
||||||
let mut buffer = String::new();
|
let mut buffer = String::new();
|
||||||
@ -1083,18 +1083,18 @@ pub(crate) fn convert_try_mac(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn macro_style(mac: &ast::MacCall, context: &RewriteContext<'_>) -> DelimToken {
|
pub(crate) fn macro_style(mac: &ast::MacCall, context: &RewriteContext<'_>) -> Delimiter {
|
||||||
let snippet = context.snippet(mac.span());
|
let snippet = context.snippet(mac.span());
|
||||||
let paren_pos = snippet.find_uncommented("(").unwrap_or(usize::max_value());
|
let paren_pos = snippet.find_uncommented("(").unwrap_or(usize::max_value());
|
||||||
let bracket_pos = snippet.find_uncommented("[").unwrap_or(usize::max_value());
|
let bracket_pos = snippet.find_uncommented("[").unwrap_or(usize::max_value());
|
||||||
let brace_pos = snippet.find_uncommented("{").unwrap_or(usize::max_value());
|
let brace_pos = snippet.find_uncommented("{").unwrap_or(usize::max_value());
|
||||||
|
|
||||||
if paren_pos < bracket_pos && paren_pos < brace_pos {
|
if paren_pos < bracket_pos && paren_pos < brace_pos {
|
||||||
DelimToken::Paren
|
Delimiter::Parenthesis
|
||||||
} else if bracket_pos < brace_pos {
|
} else if bracket_pos < brace_pos {
|
||||||
DelimToken::Bracket
|
Delimiter::Bracket
|
||||||
} else {
|
} else {
|
||||||
DelimToken::Brace
|
Delimiter::Brace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1174,7 +1174,7 @@ struct Macro {
|
|||||||
// rather than clone them, if we can make the borrowing work out.
|
// rather than clone them, if we can make the borrowing work out.
|
||||||
struct MacroBranch {
|
struct MacroBranch {
|
||||||
span: Span,
|
span: Span,
|
||||||
args_paren_kind: DelimToken,
|
args_paren_kind: Delimiter,
|
||||||
args: TokenStream,
|
args: TokenStream,
|
||||||
body: Span,
|
body: Span,
|
||||||
whole_body: Span,
|
whole_body: Span,
|
||||||
@ -1188,7 +1188,7 @@ impl MacroBranch {
|
|||||||
multi_branch_style: bool,
|
multi_branch_style: bool,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
// Only attempt to format function-like macros.
|
// Only attempt to format function-like macros.
|
||||||
if self.args_paren_kind != DelimToken::Paren {
|
if self.args_paren_kind != Delimiter::Parenthesis {
|
||||||
// FIXME(#1539): implement for non-sugared macros.
|
// FIXME(#1539): implement for non-sugared macros.
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -1350,18 +1350,18 @@ fn rewrite_macro_with_items(
|
|||||||
items: &[MacroArg],
|
items: &[MacroArg],
|
||||||
macro_name: &str,
|
macro_name: &str,
|
||||||
shape: Shape,
|
shape: Shape,
|
||||||
style: DelimToken,
|
style: Delimiter,
|
||||||
position: MacroPosition,
|
position: MacroPosition,
|
||||||
span: Span,
|
span: Span,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
let (opener, closer) = match style {
|
let (opener, closer) = match style {
|
||||||
DelimToken::Paren => ("(", ")"),
|
Delimiter::Parenthesis => ("(", ")"),
|
||||||
DelimToken::Bracket => ("[", "]"),
|
Delimiter::Bracket => ("[", "]"),
|
||||||
DelimToken::Brace => (" {", "}"),
|
Delimiter::Brace => (" {", "}"),
|
||||||
_ => return None,
|
_ => return None,
|
||||||
};
|
};
|
||||||
let trailing_semicolon = match style {
|
let trailing_semicolon = match style {
|
||||||
DelimToken::Paren | DelimToken::Bracket if position == MacroPosition::Item => ";",
|
Delimiter::Parenthesis | Delimiter::Bracket if position == MacroPosition::Item => ";",
|
||||||
_ => "",
|
_ => "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
use std::cmp::min;
|
use std::cmp::min;
|
||||||
|
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
use rustc_ast::token::DelimToken;
|
use rustc_ast::token::Delimiter;
|
||||||
use rustc_ast::{ast, ptr};
|
use rustc_ast::{ast, ptr};
|
||||||
use rustc_span::Span;
|
use rustc_span::Span;
|
||||||
|
|
||||||
@ -297,11 +297,11 @@ pub(crate) fn rewrite_with_square_brackets<'a, T: 'a + IntoOverflowableItem<'a>>
|
|||||||
shape: Shape,
|
shape: Shape,
|
||||||
span: Span,
|
span: Span,
|
||||||
force_separator_tactic: Option<SeparatorTactic>,
|
force_separator_tactic: Option<SeparatorTactic>,
|
||||||
delim_token: Option<DelimToken>,
|
delim_token: Option<Delimiter>,
|
||||||
) -> Option<String> {
|
) -> Option<String> {
|
||||||
let (lhs, rhs) = match delim_token {
|
let (lhs, rhs) = match delim_token {
|
||||||
Some(DelimToken::Paren) => ("(", ")"),
|
Some(Delimiter::Parenthesis) => ("(", ")"),
|
||||||
Some(DelimToken::Brace) => ("{", "}"),
|
Some(Delimiter::Brace) => ("{", "}"),
|
||||||
_ => ("[", "]"),
|
_ => ("[", "]"),
|
||||||
};
|
};
|
||||||
Context::new(
|
Context::new(
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use std::panic::{catch_unwind, AssertUnwindSafe};
|
use std::panic::{catch_unwind, AssertUnwindSafe};
|
||||||
|
|
||||||
use rustc_ast::ast;
|
use rustc_ast::ast;
|
||||||
use rustc_ast::token::{DelimToken, TokenKind};
|
use rustc_ast::token::{Delimiter, TokenKind};
|
||||||
use rustc_parse::parser::ForceCollect;
|
use rustc_parse::parser::ForceCollect;
|
||||||
use rustc_span::symbol::kw;
|
use rustc_span::symbol::kw;
|
||||||
|
|
||||||
@ -47,11 +47,11 @@ fn parse_cfg_if_inner<'a>(
|
|||||||
.map_err(|_| "Failed to parse attributes")?;
|
.map_err(|_| "Failed to parse attributes")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if !parser.eat(&TokenKind::OpenDelim(DelimToken::Brace)) {
|
if !parser.eat(&TokenKind::OpenDelim(Delimiter::Brace)) {
|
||||||
return Err("Expected an opening brace");
|
return Err("Expected an opening brace");
|
||||||
}
|
}
|
||||||
|
|
||||||
while parser.token != TokenKind::CloseDelim(DelimToken::Brace)
|
while parser.token != TokenKind::CloseDelim(Delimiter::Brace)
|
||||||
&& parser.token.kind != TokenKind::Eof
|
&& parser.token.kind != TokenKind::Eof
|
||||||
{
|
{
|
||||||
let item = match parser.parse_item(ForceCollect::No) {
|
let item = match parser.parse_item(ForceCollect::No) {
|
||||||
@ -70,7 +70,7 @@ fn parse_cfg_if_inner<'a>(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !parser.eat(&TokenKind::CloseDelim(DelimToken::Brace)) {
|
if !parser.eat(&TokenKind::CloseDelim(Delimiter::Brace)) {
|
||||||
return Err("Expected a closing brace");
|
return Err("Expected a closing brace");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use rustc_ast::token::{DelimToken, TokenKind};
|
use rustc_ast::token::{Delimiter, TokenKind};
|
||||||
use rustc_ast::tokenstream::TokenStream;
|
use rustc_ast::tokenstream::TokenStream;
|
||||||
use rustc_ast::{ast, ptr};
|
use rustc_ast::{ast, ptr};
|
||||||
use rustc_parse::parser::{ForceCollect, Parser};
|
use rustc_parse::parser::{ForceCollect, Parser};
|
||||||
@ -81,7 +81,7 @@ fn check_keyword<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
|
|||||||
&& parser.look_ahead(1, |t| {
|
&& parser.look_ahead(1, |t| {
|
||||||
t.kind == TokenKind::Eof
|
t.kind == TokenKind::Eof
|
||||||
|| t.kind == TokenKind::Comma
|
|| t.kind == TokenKind::Comma
|
||||||
|| t.kind == TokenKind::CloseDelim(DelimToken::NoDelim)
|
|| t.kind == TokenKind::CloseDelim(Delimiter::Invisible)
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
parser.bump();
|
parser.bump();
|
||||||
@ -97,7 +97,7 @@ fn check_keyword<'a, 'b: 'a>(parser: &'a mut Parser<'b>) -> Option<MacroArg> {
|
|||||||
pub(crate) fn parse_macro_args(
|
pub(crate) fn parse_macro_args(
|
||||||
context: &RewriteContext<'_>,
|
context: &RewriteContext<'_>,
|
||||||
tokens: TokenStream,
|
tokens: TokenStream,
|
||||||
style: DelimToken,
|
style: Delimiter,
|
||||||
forced_bracket: bool,
|
forced_bracket: bool,
|
||||||
) -> Option<ParsedMacroArgs> {
|
) -> Option<ParsedMacroArgs> {
|
||||||
let mut parser = build_parser(context, tokens);
|
let mut parser = build_parser(context, tokens);
|
||||||
@ -105,7 +105,7 @@ pub(crate) fn parse_macro_args(
|
|||||||
let mut vec_with_semi = false;
|
let mut vec_with_semi = false;
|
||||||
let mut trailing_comma = false;
|
let mut trailing_comma = false;
|
||||||
|
|
||||||
if DelimToken::Brace != style {
|
if Delimiter::Brace != style {
|
||||||
loop {
|
loop {
|
||||||
if let Some(arg) = check_keyword(&mut parser) {
|
if let Some(arg) = check_keyword(&mut parser) {
|
||||||
args.push(arg);
|
args.push(arg);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use std::cell::{Cell, RefCell};
|
use std::cell::{Cell, RefCell};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use rustc_ast::{ast, token::DelimToken, visit, AstLike};
|
use rustc_ast::{ast, token::Delimiter, visit, AstLike};
|
||||||
use rustc_data_structures::sync::Lrc;
|
use rustc_data_structures::sync::Lrc;
|
||||||
use rustc_span::{symbol, BytePos, Pos, Span};
|
use rustc_span::{symbol, BytePos, Pos, Span};
|
||||||
|
|
||||||
@ -689,7 +689,7 @@ impl<'b, 'a: 'b> FmtVisitor<'a> {
|
|||||||
// with whitespace between the delimiters and trailing semi (i.e. `foo!(abc) ;`)
|
// with whitespace between the delimiters and trailing semi (i.e. `foo!(abc) ;`)
|
||||||
// are formatted correctly.
|
// are formatted correctly.
|
||||||
let (span, rewrite) = match macro_style(mac, &self.get_context()) {
|
let (span, rewrite) = match macro_style(mac, &self.get_context()) {
|
||||||
DelimToken::Bracket | DelimToken::Paren if MacroPosition::Item == pos => {
|
Delimiter::Bracket | Delimiter::Parenthesis if MacroPosition::Item == pos => {
|
||||||
let search_span = mk_sp(mac.span().hi(), self.snippet_provider.end_pos());
|
let search_span = mk_sp(mac.span().hi(), self.snippet_provider.end_pos());
|
||||||
let hi = self.snippet_provider.span_before(search_span, ";");
|
let hi = self.snippet_provider.span_before(search_span, ";");
|
||||||
let target_span = mk_sp(mac.span().lo(), hi + BytePos(1));
|
let target_span = mk_sp(mac.span().lo(), hi + BytePos(1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user