@@ -29,16 +29,28 @@ pub fn clats_indent<'src>(depth: ColNumber) -> ConcreteLineTokenAndTargets<'src>
2929#[ derive( Debug , Clone , PartialEq , Eq ) ]
3030pub enum ConcreteLineToken < ' src > {
3131 HardNewLine ,
32- Indent { depth : u32 } ,
33- Keyword { keyword : & ' static str } ,
32+ Indent {
33+ depth : u32 ,
34+ } ,
35+ Keyword {
36+ keyword : & ' static str ,
37+ } ,
3438 DefKeyword ,
3539 ClassKeyword ,
3640 ModuleKeyword ,
3741 DoKeyword ,
38- ModKeyword { contents : & ' static str } ,
39- ConditionalKeyword { contents : & ' static str } ,
40- DirectPart { part : Cow < ' src , str > } ,
41- MethodName { name : Cow < ' src , str > } ,
42+ ModKeyword {
43+ contents : & ' static str ,
44+ } ,
45+ ConditionalKeyword {
46+ contents : & ' static str ,
47+ } ,
48+ DirectPart {
49+ part : Cow < ' src , str > ,
50+ } ,
51+ MethodName {
52+ name : Cow < ' src , str > ,
53+ } ,
4254 CommaSpace ,
4355 Comma ,
4456 Space ,
@@ -52,21 +64,34 @@ pub enum ConcreteLineToken<'src> {
5264 CloseCurlyBracket ,
5365 OpenParen ,
5466 CloseParen ,
55- Op { op : Cow < ' src , str > } ,
67+ Op {
68+ op : Cow < ' src , str > ,
69+ } ,
5670 DoubleQuote ,
57- LTStringContent { content : Cow < ' src , str > } ,
71+ LTStringContent {
72+ content : Cow < ' src , str > ,
73+ } ,
5874 SingleSlash ,
59- Comment { contents : String } ,
60- Delim { contents : & ' static str } ,
75+ Comment {
76+ contents : String ,
77+ } ,
78+ Delim {
79+ contents : & ' static str ,
80+ } ,
6181 End ,
62- HeredocClose { symbol : String } ,
82+ HeredocClose {
83+ symbol : String ,
84+ } ,
6385 DataEnd ,
6486 // These are "magic" tokens. They have no concrete representation,
6587 // but they're meaningful inside of the render queue
6688 AfterCallChain ,
6789 BeginCallChainIndent ,
6890 EndCallChainIndent ,
69- HeredocStart { kind : HeredocKind , symbol : String } ,
91+ HeredocStart {
92+ kind : HeredocKind ,
93+ symbol : Cow < ' src , str > ,
94+ } ,
7095}
7196
7297impl < ' src > ConcreteLineToken < ' src > {
@@ -105,7 +130,7 @@ impl<'src> ConcreteLineToken<'src> {
105130 Self :: End => Cow :: Borrowed ( "end" ) ,
106131 Self :: HeredocClose { symbol } => Cow :: Owned ( symbol) ,
107132 Self :: DataEnd => Cow :: Borrowed ( "__END__" ) ,
108- Self :: HeredocStart { symbol, .. } => Cow :: Owned ( symbol) ,
133+ Self :: HeredocStart { symbol, .. } => symbol,
109134 // no-op, this is purely semantic information
110135 // for the render queue
111136 Self :: AfterCallChain | Self :: BeginCallChainIndent | Self :: EndCallChainIndent => {
@@ -246,8 +271,8 @@ impl<'src> ConcreteLineTokenAndTargets<'src> {
246271pub enum AbstractLineToken < ' src > {
247272 // this is all bodil's fault
248273 ConcreteLineToken ( ConcreteLineToken < ' src > ) ,
249- CollapsingNewLine ( Option < Vec < HeredocString > > ) ,
250- SoftNewline ( Option < Vec < HeredocString > > ) ,
274+ CollapsingNewLine ( Option < Vec < HeredocString < ' src > > > ) ,
275+ SoftNewline ( Option < Vec < HeredocString < ' src > > > ) ,
251276 SoftIndent { depth : u32 } ,
252277 BreakableEntry ( BreakableEntry < ' src > ) ,
253278 BreakableCallChainEntry ( BreakableCallChainEntry < ' src > ) ,
0 commit comments