Remove hook concept
This commit is contained in:
@@ -198,19 +198,13 @@ public sealed class Parser
|
||||
{
|
||||
var memberStartIndex = _tokenIndex;
|
||||
|
||||
string? hook = null;
|
||||
if (TryExpectSymbol(Symbol.At))
|
||||
{
|
||||
hook = ExpectIdentifier().Value;
|
||||
}
|
||||
|
||||
if (TryExpectSymbol(Symbol.Func))
|
||||
{
|
||||
var funcName = ExpectIdentifier().Value;
|
||||
var funcSignature = ParseFuncSignature();
|
||||
var funcBody = ParseBlock();
|
||||
|
||||
funcs.Add(new StructFuncSyntax(GetTokens(memberStartIndex), funcName, hook, funcSignature, funcBody));
|
||||
funcs.Add(new StructFuncSyntax(GetTokens(memberStartIndex), funcName, funcSignature, funcBody));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ public record FuncSyntax(List<Token> Tokens, string Name, bool Exported, string?
|
||||
|
||||
public record StructFieldSyntax(List<Token> Tokens, string Name, TypeSyntax Type, ExpressionSyntax? Value) : SyntaxNode(Tokens);
|
||||
|
||||
public record StructFuncSyntax(List<Token> Tokens, string Name, string? Hook, FuncSignatureSyntax Signature, BlockSyntax Body) : SyntaxNode(Tokens);
|
||||
public record StructFuncSyntax(List<Token> Tokens, string Name, FuncSignatureSyntax Signature, BlockSyntax Body) : SyntaxNode(Tokens);
|
||||
|
||||
public record StructSyntax(List<Token> Tokens, string Name, bool Exported, List<StructFieldSyntax> Fields, List<StructFuncSyntax> Functions) : DefinitionSyntax(Tokens, Name, Exported);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user