Added DataCount property to sunCompilerResults.

This commit is contained in:
arookas 2015-12-10 17:16:56 -05:00
parent 90fb4fdefa
commit f0371d345e
3 changed files with 4 additions and 0 deletions

View file

@ -26,6 +26,7 @@ namespace arookas
if (results.Success)
{
Message("Finished compiling in {0:F2}ms.\n", results.CompileTime.TotalMilliseconds);
Message(" Data count: {0}\n", results.DataCount);
Message("Symbol count: {0}\n", results.SymbolCount);
Message(" - builtins: {0}\n", results.BuiltinCount);
Message(" - functions: {0}\n", results.FunctionCount);

View file

@ -43,6 +43,7 @@ namespace arookas
{
function.CloseCallSites(context);
}
results.DataCount = context.DataTable.Count;
results.SymbolCount = context.SymbolTable.Count;
results.BuiltinCount = context.SymbolTable.BuiltinCount;
results.FunctionCount = context.SymbolTable.FunctionCount;
@ -66,6 +67,7 @@ namespace arookas
public sunCompilerException Error { get; internal set; }
// statistics
public int DataCount { get; internal set; }
public int SymbolCount { get; internal set; }
public int BuiltinCount { get; internal set; }
public int FunctionCount { get; internal set; }

View file

@ -29,6 +29,7 @@ Use the various properties on this type to gather the information of the compila
|`Success`|Whether the script was compiled successfully. If not, the `Error` property should be non-null.|
|`Error`|The fatal error which occured during compilation. If compilation was successful, this should be null.|
|`CompileTime`|The time it took to compile, measured as a `TimeSpan` instance.|
|`DataCount`|The total number of data-table entries created.|
|`SymbolCount`|The total number of symbols (builtins, functions, and variables) created.|
|`BuiltinCount`|The total number of builtin symbols created.|
|`FunctionCount`|The total number of function symbols created.|