3 | | Emit a trace message for this line at compile time. |
| 3 | Emit diagnostic information for the given expression showing the expression state at various stages of its compilation. |
| 4 | |
| 5 | Mostly only of use for compiler development. |
| 6 | |
| 7 | Currently this information is |
| 8 | - expression state before binding to implementation. |
| 9 | - expression state after bind imp |
| 10 | - definition of the expression |
| 11 | - Type of the expression |
| 12 | |
| 13 | This can be used to see what intermediate definition and Type the compiler is generating for an expression. |
| 14 | |
| 31 | generates output like |
| 32 | |
| 33 | {{{ |
| 34 | |
| 35 | * Compile-time trace at Token(ID, 'ct_trace', 'ct_trace', ln 14, col 3, dec.cobra) |
| 36 | * before bind imp on expression: x = IdentifierExpr-sh(6682, didBindInh=false, didBindInt=false, didBindImp=false, |
| 37 | token=Token(ID, 'x', 'x', ln 14, col 12,dec.cobra), name=x, type=nil, 6682) |
| 38 | * after bind imp on expression: x = IdentifierExpr-sh(6682, didBindInh=false, didBindInt=false, didStartBindImp=true, didBindImp=true, token=Token(ID, 'x', 'x', ln 14, col 12, dec.cobra), name=x, type=NilableType-mi(15870, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, didBindImp=false, 15870), |
| 39 | definition=LocalVar-mi(15871, name=x, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, didStartBindImp=true, didBindImp=true, token=Token(ID, 'x', 'x', ln 13, col 3, dec.cobra), isTracked=true, isTracked=true, 15871), 6682) |
| 40 | * definition = LocalVar(15871, "x" (ID), x, dynamic?) |
| 41 | * type = NilableType-sh(15870, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, didBindImp=false, wrappedType=DynamicType-mi(9750, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, |
| 42 | didBindImp=false, 9750), 15870) |
| 43 | }}} |