Skip to content

Commit c535b02

Browse files
committed
Slight tidyup; add initial values
1 parent 804db80 commit c535b02

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

YarnSpinner.Compiler/CompilationJob.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ public class File : ISourceInput
4545
/// between. This is useful for diagnostics, and for attributing
4646
/// <see cref="Line"/> objects to their original source
4747
/// files.</remarks>
48-
public string FileName { get; set; }
48+
public string FileName { get; set; } = "<unknown>";
4949

5050
/// <summary>
5151
/// The source code of this file.
5252
/// </summary>
53-
public string Source;
53+
public string Source = string.Empty;
5454
}
5555

56-
57-
5856
/// <summary>
5957
/// The type of compilation that the compiler will do.
6058
/// </summary>
@@ -101,7 +99,6 @@ public IEnumerable<File> Files
10199
}
102100
}
103101

104-
105102
public IEnumerable<ISourceInput> Inputs;
106103

107104
/// <summary>

YarnSpinner/YarnSpinner.Markup/LineParser.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,11 +776,12 @@ private MarkupProperty internalIDproperty()
776776
// where the b tag is a rewriter and the emotion tag is not.
777777
// in that case because previously we only kept the last fully processed non-replacement sibling the emotion tag would eat the whitespace AFTER the b tag had replaced itself
778778
private MarkupTreeNode? sibling = null;
779+
779780
// this keeps track of all accumulated invisible characters added by any replacement markup.
780781
// this is necessary to prevent a bug with the following:
781-
// "this is a line [bold]with some replacement[/bold] markup and a non-replacement[a/] markup"
782+
// "this is a line [bold]with some replacement[/bold] markup and a non-replacement[a/] markup"
782783
// assuming that this is intended to replace the [bold] with <b> in unity we would end up as though we had written:
783-
// "this is a line <b>with some replacement</b> markup and a non-replacement[a/] markup"
784+
// "this is a line <b>with some replacement</b> markup and a non-replacement[a/] markup"
784785
// but this has now pushed the [a] markup down by 7 invisible characters
785786
// so each replacement markup processor needs to let us know how many (if any) invisible characters there are so we can backshift any sibling attributes after a replacement markup
786787
private int invisibleCharacters = 0;

0 commit comments

Comments
 (0)