mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Start replacing tokens
This commit is contained in:
parent
c8b4c36f81
commit
1c5d859195
3 changed files with 17 additions and 35 deletions
|
@ -345,6 +345,7 @@ fn generate_nodes(kinds: KindsSrc<'_>, grammar: AstSrc<'_>) -> Result<String> {
|
|||
#(#displays)*
|
||||
};
|
||||
|
||||
let ast = ast.to_string().replace("T ! [ ", "T![").replace(" ] )", "])");
|
||||
let pretty = crate::reformat(ast)?;
|
||||
Ok(pretty)
|
||||
}
|
||||
|
@ -527,6 +528,9 @@ impl Field<'_> {
|
|||
Field::Token(name) => {
|
||||
let name = match *name {
|
||||
";" => "semicolon",
|
||||
"->" => "thin_arrow",
|
||||
"'{'" => "l_curly",
|
||||
"'}'" => "r_curly",
|
||||
_ => name,
|
||||
};
|
||||
format_ident!("{}_token", name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue