kate butchered averything :(
This commit is contained in:
@@ -1048,25 +1048,25 @@ abstract class Cpp2BeefGenerator
|
||||
|
||||
//TODO: move to custom utils
|
||||
/* // This formats the tokens instead of copying the format 1:1
|
||||
* const CXTokenKind Unary = (.)-1;
|
||||
* var prevKind;
|
||||
* for (let token in tokens)
|
||||
* {
|
||||
* let spelling = ScopeCXString!(Clang.GetTokenSpelling(unit, token));
|
||||
* let kind = Clang.GetTokenKind(token);
|
||||
* token: switch (kind)
|
||||
* {
|
||||
* case .Keyword, .Identifier, .Literal:
|
||||
* if (prevKind == .Keyword || prevKind == .Identifier || prevKind == .Punctuation)
|
||||
* str.Append(' ');
|
||||
* if (kind == .Identifier) do
|
||||
* {
|
||||
* var cursor = Clang.GetCursor(unit, Clang.GetTokenLocation(unit, token));
|
||||
* if (Clang.Cursor_IsNull(cursor) != 0) break;
|
||||
* cursor = Clang.GetCursorDefinition(cursor);
|
||||
* if (Clang.Cursor_IsNull(cursor) != 0) break;
|
||||
* GetNameInBindings(cursor, str);
|
||||
* break token;
|
||||
const CXTokenKind Unary = (.)-1;
|
||||
var prevKind;
|
||||
for (let token in tokens)
|
||||
{
|
||||
let spelling = ScopeCXString!(Clang.GetTokenSpelling(unit, token));
|
||||
let kind = Clang.GetTokenKind(token);
|
||||
token: switch (kind)
|
||||
{
|
||||
case .Keyword, .Identifier, .Literal:
|
||||
if (prevKind == .Keyword || prevKind == .Identifier || prevKind == .Punctuation)
|
||||
str.Append(' ');
|
||||
if (kind == .Identifier) do
|
||||
{
|
||||
var cursor = Clang.GetCursor(unit, Clang.GetTokenLocation(unit, token));
|
||||
if (Clang.Cursor_IsNull(cursor) != 0) break;
|
||||
cursor = Clang.GetCursorDefinition(cursor);
|
||||
if (Clang.Cursor_IsNull(cursor) != 0) break;
|
||||
GetNameInBindings(cursor, str);
|
||||
break token;
|
||||
}
|
||||
str.Append(spelling);
|
||||
if (kind == .Literal && str.EndsWith("LL"))
|
||||
@@ -1407,17 +1407,17 @@ abstract class Cpp2BeefGenerator
|
||||
BeginBody!(cursor);
|
||||
//TODO
|
||||
/*Clang.VisitChildren(cursor, (cursor, parent, client_data) =>
|
||||
* {
|
||||
* Self self = (.)Internal.UnsafeCastToObject(client_data);
|
||||
* switch (cursor.kind)
|
||||
* {
|
||||
* case .FieldDecl, .CXXMethod, .Constructor, .Destructor, .ConversionFunction, .FunctionDecl, .VarDecl,
|
||||
* .FunctionTemplate, .ClassTemplate, .TypeAliasTemplateDecl, .StructDecl, .ClassDecl,
|
||||
* .UnionDecl, .EnumDecl, .TypeAliasDecl, .TypedefDecl:
|
||||
* self.WriteComments(cursor);
|
||||
* return .Break;
|
||||
* default:
|
||||
* return .Continue;
|
||||
{
|
||||
Self self = (.)Internal.UnsafeCastToObject(client_data);
|
||||
switch (cursor.kind)
|
||||
{
|
||||
case .FieldDecl, .CXXMethod, .Constructor, .Destructor, .ConversionFunction, .FunctionDecl, .VarDecl,
|
||||
.FunctionTemplate, .ClassTemplate, .TypeAliasTemplateDecl, .StructDecl, .ClassDecl,
|
||||
.UnionDecl, .EnumDecl, .TypeAliasDecl, .TypedefDecl:
|
||||
self.WriteComments(cursor);
|
||||
return .Break;
|
||||
default:
|
||||
return .Continue;
|
||||
}
|
||||
}, Internal.UnsafeCastToPtr(this));*/
|
||||
|
||||
@@ -1445,12 +1445,12 @@ abstract class Cpp2BeefGenerator
|
||||
str.Append(">\";\n", cursorIndent);
|
||||
str.Append("private const String __template_chain = CppWrapperF($\"", wrapperTemplateChain, "\");\n\n", cursorIndent);
|
||||
/*str.Append("[CppWriteToWrapper<\"", WrapperFilePath, "\">(\"\\ntemplate ");
|
||||
* switch (cursor.kind)
|
||||
* {
|
||||
* case .StructDecl: str.Append("struct ");
|
||||
* case . ClassDecl: str.Append("class " );
|
||||
* case . UnionDecl: str.Append("union " );
|
||||
* default: Runtime.FatalError();
|
||||
switch (cursor.kind)
|
||||
{
|
||||
case .StructDecl: str.Append("struct ");
|
||||
case . ClassDecl: str.Append("class " );
|
||||
case . UnionDecl: str.Append("union " );
|
||||
default: Runtime.FatalError();
|
||||
}
|
||||
str.Append("\" + __cpp_type + \";\\n\")]\n\n", indent);*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user