Rename struct member to struct field
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
Reference in New Issue
Block a user