You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
internal/astinternal: make it easier to debug references
The `astutil.Sanitize` logic tries to respect `Ident.Node` references,
but when debugging generated syntax, it's hard to be sure whether the
Node references are pointing to the correct places.
This adds functionality to `astinternal.AppendDebug` to cause it to
print references and their referred-to nodes in a somewhat friendly
manner.
Here's a (slightly abbreviated) example of its output from a recent
debugging session:
Value: *ast.StructLit@ref001{
Elts: []ast.Decl{
*ast.Field{
Label: *ast.Ident{
Name: "next"
}
Value: *ast.Ident{
Name: "_schema"
Node: @ref001 (*ast.StructLit)
}
}
}
}
Signed-off-by: Roger Peppe <[email protected]>
Change-Id: I2f859f3b8d365c6ba3408902039f2aa9cbd8a679
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1205069
Reviewed-by: Daniel Martí <[email protected]>
Unity-Result: CUE porcuepine <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
0 commit comments