Rename struct member to struct field

This commit is contained in:
nub31
2025-05-04 19:30:06 +02:00
parent 862971bf17
commit 6755342cdb
3 changed files with 5 additions and 5 deletions

View File

@@ -107,7 +107,7 @@ public class Parser
ExpectSymbol(Symbol.OpenBrace); ExpectSymbol(Symbol.OpenBrace);
List<StructMember> variables = []; List<StructField> variables = [];
while (!TryExpectSymbol(Symbol.CloseBrace)) while (!TryExpectSymbol(Symbol.CloseBrace))
{ {
@@ -124,7 +124,7 @@ public class Parser
ExpectSymbol(Symbol.Semicolon); ExpectSymbol(Symbol.Semicolon);
variables.Add(new StructMember(variableName, variableType, variableValue)); variables.Add(new StructField(variableName, variableType, variableValue));
} }
return new StructDefinitionNode(name, variables); return new StructDefinitionNode(name, variables);

View File

@@ -1,7 +1,7 @@
namespace Nub.Lang.Frontend.Parsing; namespace Nub.Lang.Frontend.Parsing;
public class StructDefinitionNode(string name, List<StructMember> members) : DefinitionNode public class StructDefinitionNode(string name, List<StructField> members) : DefinitionNode
{ {
public string Name { get; } = name; public string Name { get; } = name;
public List<StructMember> Members { get; } = members; public List<StructField> Members { get; } = members;
} }

View File

@@ -2,7 +2,7 @@
namespace Nub.Lang; namespace Nub.Lang;
public class StructMember(string name, NubType type, Optional<ExpressionNode> value) public class StructField(string name, NubType type, Optional<ExpressionNode> value)
{ {
public string Name { get; } = name; public string Name { get; } = name;
public NubType Type { get; } = type; public NubType Type { get; } = type;