diff options
Diffstat (limited to 'src/WixToolset.Data/IntermediateTuple.cs')
| -rw-r--r-- | src/WixToolset.Data/IntermediateTuple.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/WixToolset.Data/IntermediateTuple.cs b/src/WixToolset.Data/IntermediateTuple.cs index 9146b2be..4030df5d 100644 --- a/src/WixToolset.Data/IntermediateTuple.cs +++ b/src/WixToolset.Data/IntermediateTuple.cs | |||
| @@ -7,15 +7,15 @@ namespace WixToolset.Data | |||
| 7 | using SimpleJson; | 7 | using SimpleJson; |
| 8 | 8 | ||
| 9 | [DebuggerDisplay("{DebuggerDisplay,nq}")] | 9 | [DebuggerDisplay("{DebuggerDisplay,nq}")] |
| 10 | public class IntermediateTuple | 10 | public class IntermediateSymbol |
| 11 | { | 11 | { |
| 12 | private object tags; | 12 | private object tags; |
| 13 | 13 | ||
| 14 | public IntermediateTuple(IntermediateTupleDefinition definition) : this(definition, null, null) | 14 | public IntermediateSymbol(IntermediateSymbolDefinition definition) : this(definition, null, null) |
| 15 | { | 15 | { |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | public IntermediateTuple(IntermediateTupleDefinition definition, SourceLineNumber sourceLineNumber, Identifier id = null) | 18 | public IntermediateSymbol(IntermediateSymbolDefinition definition, SourceLineNumber sourceLineNumber, Identifier id = null) |
| 19 | { | 19 | { |
| 20 | this.Definition = definition; | 20 | this.Definition = definition; |
| 21 | this.Fields = new IntermediateField[definition.FieldDefinitions.Length]; | 21 | this.Fields = new IntermediateField[definition.FieldDefinitions.Length]; |
| @@ -23,7 +23,7 @@ namespace WixToolset.Data | |||
| 23 | this.Id = id; | 23 | this.Id = id; |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | public IntermediateTupleDefinition Definition { get; } | 26 | public IntermediateSymbolDefinition Definition { get; } |
| 27 | 27 | ||
| 28 | public IntermediateField[] Fields { get; } | 28 | public IntermediateField[] Fields { get; } |
| 29 | 29 | ||
| @@ -154,7 +154,7 @@ namespace WixToolset.Data | |||
| 154 | return false; | 154 | return false; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | internal static IntermediateTuple Deserialize(ITupleDefinitionCreator creator, Uri baseUri, JsonObject jsonObject) | 157 | internal static IntermediateSymbol Deserialize(ISymbolDefinitionCreator creator, Uri baseUri, JsonObject jsonObject) |
| 158 | { | 158 | { |
| 159 | var definitionName = jsonObject.GetValueOrDefault<string>("type"); | 159 | var definitionName = jsonObject.GetValueOrDefault<string>("type"); |
| 160 | var idJson = jsonObject.GetValueOrDefault<JsonObject>("id"); | 160 | var idJson = jsonObject.GetValueOrDefault<JsonObject>("id"); |
| @@ -166,18 +166,18 @@ namespace WixToolset.Data | |||
| 166 | var sourceLineNumbers = (sourceLineNumbersJson == null) ? null : SourceLineNumber.Deserialize(sourceLineNumbersJson); | 166 | var sourceLineNumbers = (sourceLineNumbersJson == null) ? null : SourceLineNumber.Deserialize(sourceLineNumbersJson); |
| 167 | 167 | ||
| 168 | // TODO: this isn't sufficient. | 168 | // TODO: this isn't sufficient. |
| 169 | if (!creator.TryGetTupleDefinitionByName(definitionName, out var definition)) | 169 | if (!creator.TryGetSymbolDefinitionByName(definitionName, out var definition)) |
| 170 | { | 170 | { |
| 171 | throw new WixException(ErrorMessages.UnknownSymbolType(definitionName)); | 171 | throw new WixException(ErrorMessages.UnknownSymbolType(definitionName)); |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | var tuple = definition.CreateTuple(sourceLineNumbers, id); | 174 | var symbol = definition.CreateSymbol(sourceLineNumbers, id); |
| 175 | 175 | ||
| 176 | for (var i = 0; i < fieldsJson.Count && i < tuple.Fields.Length; ++i) | 176 | for (var i = 0; i < fieldsJson.Count && i < symbol.Fields.Length; ++i) |
| 177 | { | 177 | { |
| 178 | if (fieldsJson[i] is JsonObject fieldJson) | 178 | if (fieldsJson[i] is JsonObject fieldJson) |
| 179 | { | 179 | { |
| 180 | tuple.Fields[i] = IntermediateField.Deserialize(tuple.Definition.FieldDefinitions[i], baseUri, fieldJson); | 180 | symbol.Fields[i] = IntermediateField.Deserialize(symbol.Definition.FieldDefinitions[i], baseUri, fieldJson); |
| 181 | } | 181 | } |
| 182 | } | 182 | } |
| 183 | 183 | ||
| @@ -186,7 +186,7 @@ namespace WixToolset.Data | |||
| 186 | } | 186 | } |
| 187 | else if (tagsJson.Count == 1) | 187 | else if (tagsJson.Count == 1) |
| 188 | { | 188 | { |
| 189 | tuple.tags = (string)tagsJson[0]; | 189 | symbol.tags = (string)tagsJson[0]; |
| 190 | } | 190 | } |
| 191 | else | 191 | else |
| 192 | { | 192 | { |
| @@ -197,10 +197,10 @@ namespace WixToolset.Data | |||
| 197 | tags[i] = (string)tagsJson[i]; | 197 | tags[i] = (string)tagsJson[i]; |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | tuple.tags = tags; | 200 | symbol.tags = tags; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | return tuple; | 203 | return symbol; |
| 204 | } | 204 | } |
| 205 | 205 | ||
| 206 | internal JsonObject Serialize() | 206 | internal JsonObject Serialize() |
