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
Currently, the FullComment AST node is correct handled if the parent node is FunctionDecl. However, if the parent node of the FullComment node is VarDecl, the comment is dropped during transpilation and a warning comment is emitted.
Example input C source code
not working Example where comment is dropped (not transpiled).
/** * foo */intx;
working Example where comment is kept (transpiled).
/* Package main - transpiled by c2go version: v0.25.9 Dubnium 2018-12-30 If you have found any issues, please raise an issue at: https://github.com/elliotchance/c2go/*/// Warning (FullComment): /home/u/Desktop/ccc/n/n.c:2 : cannot transpile to expr// Warning (VarDecl): /home/u/Desktop/ccc/n/n.c:4 : Cannot casting { -> int}. err = Cannot resolve type '' : probably an incorrect type translation 1package main
var// Warning (FullComment): /home/u/Desktop/ccc/n/n.c:2 : cannot transpile to expr// Warning (VarDecl): /home/u/Desktop/ccc/n/n.c:4 : Cannot casting { -> int}. err = Cannot resolve type '' : probably an incorrect type translation 1xint32funcinit() {
}
In particular, note the // Warning (FullComment): /home/u/Desktop/ccc/n/n.c:2 : cannot transpile to expr comment.
Additional information
For reference, this is what the output Go source code looks like for a FullComment AST node with a FunctionDecl parent node:
/* Package main - transpiled by c2go version: v0.25.9 Dubnium 2018-12-30 If you have found any issues, please raise an issue at: https://github.com/elliotchance/c2go/*/package main
// f - transpiled function from /home/u/Desktop/ccc/n/n.c:4/** * foo */////funcf(xint32) int32 {
returnx
}
funcinit() {
}
The text was updated successfully, but these errors were encountered:
Currently, the
FullComment
AST node is correct handled if the parent node isFunctionDecl
. However, if the parent node of theFullComment
node isVarDecl
, the comment is dropped during transpilation and a warning comment is emitted.Example input C source code
not working Example where comment is dropped (not transpiled).
working Example where comment is kept (transpiled).
AST
Example output Go source code
In particular, note the
// Warning (FullComment): /home/u/Desktop/ccc/n/n.c:2 : cannot transpile to expr
comment.Additional information
For reference, this is what the output Go source code looks like for a
FullComment
AST node with aFunctionDecl
parent node:The text was updated successfully, but these errors were encountered: