@@ -81,14 +81,16 @@ public function process(File $phpcsFile, $stackPtr)
8181
8282 $ ptrPadding = \max (3 , \strlen ($ last ));
8383 $ linePadding = \strlen ($ tokens [$ last ]['line ' ]);
84+ $ sep = ' | ' ;
8485
8586 echo \PHP_EOL ;
8687 echo \str_pad ('Ptr ' , $ ptrPadding , ' ' , \STR_PAD_BOTH ),
87- ' :: ' , \str_pad ('Ln ' , ($ linePadding + 1 ), ' ' , \STR_PAD_BOTH ),
88- ' :: ' , \str_pad ('Col ' , 4 , ' ' , \STR_PAD_BOTH ),
89- ' :: ' , 'Cond ' ,
90- ' :: ' , \str_pad ('Token Type ' , 26 ), // Longest token type name is 26 chars.
91- ' :: [len]: Content ' , \PHP_EOL ;
88+ $ sep , \str_pad ('Ln ' , ($ linePadding + 1 ), ' ' , \STR_PAD_BOTH ),
89+ $ sep , 'Col ' ,
90+ $ sep , 'Cond ' ,
91+ $ sep , '( #) ' ,
92+ $ sep , \str_pad ('Token Type ' , 26 ), // Longest token type name is 26 chars.
93+ $ sep , '[len]: Content ' , \PHP_EOL ;
9294
9395 echo \str_repeat ('- ' , ($ ptrPadding + $ linePadding + 35 + 16 + 18 )), \PHP_EOL ;
9496
@@ -111,18 +113,22 @@ public function process(File $phpcsFile, $stackPtr)
111113 $ content = \str_replace ("\t" , '\t ' , $ content );
112114 }
113115 if (isset ($ token ['orig_content ' ])) {
114- $ content .= ' :: Orig: ' . \str_replace ("\t" , '\t ' , $ token ['orig_content ' ]);
116+ $ content .= $ sep . ' Orig: ' . \str_replace ("\t" , '\t ' , $ token ['orig_content ' ]);
115117 }
116118 }
117119
118- $ conditionCount = \count ($ token ['conditions ' ]);
120+ $ parenthesesCount = 0 ;
121+ if (isset ($ token ['nested_parenthesis ' ])) {
122+ $ parenthesesCount = \count ($ token ['nested_parenthesis ' ]);
123+ }
119124
120125 echo \str_pad ($ ptr , $ ptrPadding , ' ' , \STR_PAD_LEFT ),
121- ' :: L ' , \str_pad ($ token ['line ' ], $ linePadding , '0 ' , \STR_PAD_LEFT ),
122- ' :: C ' , \str_pad ($ token ['column ' ], 3 , ' ' , \STR_PAD_LEFT ),
123- ' :: CC ' , \str_pad ($ conditionCount , 2 , ' ' , \STR_PAD_LEFT ),
124- ' :: ' , \str_pad ($ token ['type ' ], 26 ), // Longest token type name is 26 chars.
125- ' :: [ ' , $ token ['length ' ], ']: ' , $ content , \PHP_EOL ;
126+ $ sep , 'L ' , \str_pad ($ token ['line ' ], $ linePadding , '0 ' , \STR_PAD_LEFT ),
127+ $ sep , 'C ' , \str_pad ($ token ['column ' ], 3 , ' ' , \STR_PAD_LEFT ),
128+ $ sep , 'CC ' , \str_pad ($ token ['level ' ], 2 , ' ' , \STR_PAD_LEFT ),
129+ $ sep , '( ' , \str_pad ($ parenthesesCount , 2 , ' ' , \STR_PAD_LEFT ), ') ' ,
130+ $ sep , \str_pad ($ token ['type ' ], 26 ), // Longest token type name is 26 chars.
131+ $ sep , '[ ' , $ token ['length ' ], ']: ' , $ content , \PHP_EOL ;
126132 }
127133
128134 // Only do this once per file.
0 commit comments