-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+semver: major
- Loading branch information
Showing
9 changed files
with
90 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace YarnSpinnerConsole | ||
{ | ||
using System; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text.Json; | ||
using Yarn.Compiler; | ||
|
||
public static class DumpCompiledCodeCommand | ||
{ | ||
public static void DumpCompiledCode(FileInfo[] inputs, bool allowPreviewFeatures) | ||
{ | ||
if (inputs == null) | ||
{ | ||
throw new ArgumentNullException(nameof(inputs)); | ||
} | ||
|
||
var compiledResults = YarnSpinnerConsole.CompileProgram(inputs); | ||
|
||
System.Func<string, string> stringLookupHelper = (input) => | ||
{ | ||
if (compiledResults.StringTable.TryGetValue(input, out var result)) | ||
{ | ||
return result.text; | ||
} | ||
else | ||
{ | ||
return null; | ||
} | ||
}; | ||
|
||
Console.WriteLine(Yarn.Compiler.Utility.GetCompiledCodeAsString(compiledResults.Program, null, compiledResults)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ public static void ExtractStrings(FileInfo[] inputs, string format, string[] col | |
location = output.FullName; | ||
} | ||
|
||
var lineBlocks = Yarn.Compiler.Utility.ExtractStringBlocks(compiledResults.Program.Nodes.Values); | ||
var lineBlocks = Yarn.Compiler.Utility.ExtractStringBlocks(compiledResults.Program.Nodes.Values, compiledResults.ProjectDebugInfo); | ||
var stringTable = compiledResults.StringTable; | ||
|
||
bool includeCharacters = true; | ||
|
@@ -143,7 +143,7 @@ public interface StringWriter | |
public void Format(HashSet<string> characters); | ||
public void WriteFile(string location); | ||
} | ||
public class CSVStringWriter: StringWriter | ||
public class CSVStringWriter : StringWriter | ||
Check warning on line 146 in src/YarnSpinner.Console/Commands/StringExtractCommand.cs
|
||
{ | ||
private string[] columns; | ||
private StreamWriter stream; | ||
|
@@ -191,7 +191,7 @@ public void WriteFile(string location) | |
} | ||
} | ||
|
||
public class ExcelStringWriter: StringWriter | ||
public class ExcelStringWriter : StringWriter | ||
{ | ||
private int rowIndex = 1; | ||
private int columnIndex = 1; | ||
|
@@ -212,7 +212,7 @@ public ExcelStringWriter(string[] columns) | |
sheet.Cell(rowIndex, j + 1).Value = columns[j]; | ||
} | ||
|
||
sheet.Row(rowIndex).Style.Font.Bold = true; | ||
sheet.Row(rowIndex).Style.Font.Bold = true; | ||
sheet.Row(rowIndex).Style.Fill.BackgroundColor = XLColor.DarkGray; | ||
sheet.Row(rowIndex).Style.Font.FontColor = XLColor.White; | ||
sheet.SheetView.FreezeRows(1); | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters