Generate runtime conversion diagnostics
Instead of inserting a comment with error description into the generated code, generate a call to a function that will print out a conversion error when executed. Do not print generic "partially converted" message anymore. Remove --verbose and --no_warnings options. Bug: 204062171 Test: internal Change-Id: Ib126e16dc76f49635e4939e670922f2561781049
This commit is contained in:
@@ -183,6 +183,7 @@ type assignmentNode struct {
|
||||
value starlarkExpr
|
||||
mkValue *mkparser.MakeString
|
||||
flavor assignmentFlavor
|
||||
location ErrorLocation
|
||||
isTraced bool
|
||||
previous *assignmentNode
|
||||
}
|
||||
@@ -223,18 +224,6 @@ func (in *ifNode) emit(gctx *generationContext) {
|
||||
}
|
||||
|
||||
gctx.newLine()
|
||||
if bad, ok := in.expr.(*badExpr); ok {
|
||||
gctx.write("# MK2STAR ERROR converting:")
|
||||
gctx.newLine()
|
||||
gctx.writef("# %s", bad.node.Dump())
|
||||
gctx.newLine()
|
||||
gctx.writef("# %s", bad.message)
|
||||
gctx.newLine()
|
||||
// The init function emits a warning if the conversion was not
|
||||
// fullly successful, so here we (arbitrarily) take the false path.
|
||||
gctx.writef("%sFalse:", ifElif)
|
||||
return
|
||||
}
|
||||
gctx.write(ifElif)
|
||||
in.expr.emit(gctx)
|
||||
gctx.write(":")
|
||||
|
Reference in New Issue
Block a user