fix static block appearing before rsquirly
This commit is contained in:
@@ -154,6 +154,9 @@ abstract class Cpp2BeefGenerator
|
|||||||
case .Namespace: BeginCursor(cursor); Namespace(cursor);
|
case .Namespace: BeginCursor(cursor); Namespace(cursor);
|
||||||
case .FunctionDecl: BeginCursor(cursor); FunctionDecl(cursor);
|
case .FunctionDecl: BeginCursor(cursor); FunctionDecl(cursor);
|
||||||
|
|
||||||
|
case .FunctionTemplate, .ClassTemplate, .TypeAliasTemplateDecl:
|
||||||
|
Runtime.FatalError("Templates are currently unsupported but Coming Soon tm");
|
||||||
|
|
||||||
case .CXXMethod,
|
case .CXXMethod,
|
||||||
.Constructor,
|
.Constructor,
|
||||||
.Destructor,
|
.Destructor,
|
||||||
@@ -408,7 +411,6 @@ abstract class Cpp2BeefGenerator
|
|||||||
switch (cursor.kind)
|
switch (cursor.kind)
|
||||||
{
|
{
|
||||||
case .FunctionTemplate, .ClassTemplate, .TypeAliasTemplateDecl:
|
case .FunctionTemplate, .ClassTemplate, .TypeAliasTemplateDecl:
|
||||||
Runtime.FatalError("Templates are currently unsupported but Coming Soon tm");
|
|
||||||
templateParams.Append('<');
|
templateParams.Append('<');
|
||||||
let len = wrapperTemplateChain.Length;
|
let len = wrapperTemplateChain.Length;
|
||||||
Clang.VisitChildren(cursor, (cursor, parent, client_data) =>
|
Clang.VisitChildren(cursor, (cursor, parent, client_data) =>
|
||||||
@@ -542,6 +544,9 @@ abstract class Cpp2BeefGenerator
|
|||||||
}
|
}
|
||||||
protected virtual void WriteComments(CXSourceLocation writeUntil, Block? block = null)
|
protected virtual void WriteComments(CXSourceLocation writeUntil, Block? block = null)
|
||||||
{
|
{
|
||||||
|
var block;
|
||||||
|
if (fileInfo.queuedTokens != .None) block = null;
|
||||||
|
|
||||||
Clang.GetFileLocation(writeUntil, let curFile, let curLine, let curColumn, let curOffset);
|
Clang.GetFileLocation(writeUntil, let curFile, let curLine, let curColumn, let curOffset);
|
||||||
Clang.GetFileLocation(fileInfo.prevEnd, let prevFile, let prevLine, let prevColumn, let prevOffset);
|
Clang.GetFileLocation(fileInfo.prevEnd, let prevFile, let prevLine, let prevColumn, let prevOffset);
|
||||||
|
|
||||||
@@ -587,6 +592,7 @@ abstract class Cpp2BeefGenerator
|
|||||||
|
|
||||||
void Block()
|
void Block()
|
||||||
{
|
{
|
||||||
|
if (fileInfo.queuedTokens != .None) return;
|
||||||
findMacros: do
|
findMacros: do
|
||||||
{
|
{
|
||||||
for (uint32 ln = line; ln < curLine; ln++)
|
for (uint32 ln = line; ln < curLine; ln++)
|
||||||
@@ -620,6 +626,7 @@ abstract class Cpp2BeefGenerator
|
|||||||
QueuedToken!(decltype(fileInfo.queuedTokens).RSquirly, "}");
|
QueuedToken!(decltype(fileInfo.queuedTokens).RSquirly, "}");
|
||||||
|
|
||||||
if (!isWritingQueuedToken) continue;
|
if (!isWritingQueuedToken) continue;
|
||||||
|
if (fileInfo.queuedTokens == .None) block = @block;
|
||||||
default: continue;
|
default: continue;
|
||||||
}
|
}
|
||||||
let location = Clang.GetTokenLocation(unit, token);
|
let location = Clang.GetTokenLocation(unit, token);
|
||||||
@@ -637,7 +644,7 @@ abstract class Cpp2BeefGenerator
|
|||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
WriteLinesUntil!(curLine, writeUntil);
|
WriteLinesUntil!(curLine, writeUntil);
|
||||||
if (block.HasValue) WriteBlock(block.Value);
|
if (@block.HasValue) WriteBlock(@block.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected enum TypeParamMode { None, InParam, OutParam }
|
protected enum TypeParamMode { None, InParam, OutParam }
|
||||||
@@ -940,7 +947,7 @@ abstract class Cpp2BeefGenerator
|
|||||||
String whitespace;
|
String whitespace;
|
||||||
if (preserveColumns)
|
if (preserveColumns)
|
||||||
{
|
{
|
||||||
whitespace = scope .(str);
|
whitespace = scope:: .(str);
|
||||||
str.Clear();
|
str.Clear();
|
||||||
Type(type);
|
Type(type);
|
||||||
whitespace.Length -= Math.Min(str.Length, whitespace.Length);
|
whitespace.Length -= Math.Min(str.Length, whitespace.Length);
|
||||||
|
|||||||
Reference in New Issue
Block a user