From f0371d345e46866c5daf19f9b723ae688b75fc1b Mon Sep 17 00:00:00 2001 From: arookas Date: Thu, 10 Dec 2015 17:16:56 -0500 Subject: [PATCH] Added DataCount property to sunCompilerResults. --- cmdline frontend/main.cs | 1 + compiler.cs | 2 ++ readme.md | 1 + 3 files changed, 4 insertions(+) diff --git a/cmdline frontend/main.cs b/cmdline frontend/main.cs index 42e38a4..1a5e836 100644 --- a/cmdline frontend/main.cs +++ b/cmdline frontend/main.cs @@ -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); diff --git a/compiler.cs b/compiler.cs index b3774cc..0f12483 100644 --- a/compiler.cs +++ b/compiler.cs @@ -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; } diff --git a/readme.md b/readme.md index ee5a982..ff98b1e 100644 --- a/readme.md +++ b/readme.md @@ -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.|