aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorgriesemer <gri@golang.org>2017-10-11 11:14:30 -0700
committerRobert Griesemer <gri@golang.org>2017-10-16 17:18:08 +0000
commit4b7325c7e30fcfd3aec4bc5968069c07f0f48e21 (patch)
tree13bb6ce49718a9c26267d5e50ba89c91770b3c12 /src/runtime
parent5ddd3d588c589ae644cadd2d8e5341669dae888e (diff)
downloadgo-4b7325c7e30fcfd3aec4bc5968069c07f0f48e21.tar.xz
cmd/compile/internal/syntax: cleanups around parser tracing
These changes affect the parser only when the internal trace constant is set. - factored our printing code used for tracing - streamlined advance function and added trace output The parser's trace output now more clearly prints what tokens are skipped and which is the next token in case of an error. Example trace: 4: . . . . . . . . . . call ( 4: . . . . . . . . . . . expr ( 4: . . . . . . . . . . . . unaryExpr ( 4: . . . . . . . . . . . . . pexpr ( 4: . . . . . . . . . . . . . . operand name ( 4: . . . . . . . . . . . . . . ) 4: . . . . . . . . . . . . . . call ( 4: . . . . . . . . . . . . . . ) 4: . . . . . . . . . . . . . ) 4: . . . . . . . . . . . . ) 4: . . . . . . . . . . . ) 4: . . . . . . . . . . . syntax error: expecting comma or ) 4: . . . . . . . . . . . skip ; 6: . . . . . . . . . . . skip name 6: . . . . . . . . . . . skip := 6: . . . . . . . . . . . skip literal 6: . . . . . . . . . . . skip ; 7: . . . . . . . . . . . skip } 7: . . . . . . . . . . . skip ; 9: . . . . . . . . . . . skip func 9: . . . . . . . . . . . skip name 9: . . . . . . . . . . . skip ( 9: . . . . . . . . . . . next ) 9: . . . . . . . . . . ) For #22164. Change-Id: I4a233696b1f989ee3287472172afaf92cf424565 Reviewed-on: https://go-review.googlesource.com/70490 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/runtime')
0 files changed, 0 insertions, 0 deletions