Commit f49cfe1
committed
parser debugging output: strip token name prefixes
Some of the names of parser (perly.y) tokens have a common prefix, such
as
PERLY_SEMICOLON
PERLY_AMPERSAND
KW_PACKAGE
KW_CLASS
Perl's -Dpv switch produces debugging output that also displays the top
few items on the parse stack. The token names are truncated for
compactness' sake. This currently leads to a display where its mostly
just the token name's prefix that is displayed, e.g.
$ perl -Dpv -e'package Foo'
...
index: 1 2 3 4 5 6 7 8
state: 1 9 17 149 91 263 412 503
token: GRAMPROG @1 remember stmtseq KW_PACKA BAREWORD BAREWORD PERLY_SE
value: 0 0 63 (Nullop) 0 (Nullop) const 735909768
After this commit, PERLY_, KW_ etc prefixes are stripped, allowing more
of the actual token name is displayed:
index: 1 2 3 4 5 6 7 8
state: 1 9 17 149 91 263 412 503
token: GRAMPROG @1 remember stmtseq PACKAGE BAREWORD BAREWORD SEMICOLO
value: 0 0 63 (Nullop) 0 (Nullop) const 2275393041 parent 7bcccf4 commit f49cfe1
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
131 | 140 | | |
132 | 141 | | |
133 | 142 | | |
| |||
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
153 | | - | |
154 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
155 | 177 | | |
156 | 178 | | |
157 | 179 | | |
| |||
0 commit comments