diff --git a/Src/AST/Myc.Ast.Script.pas b/Src/AST/Myc.Ast.Script.pas index ed0636b..eca89b6 100644 --- a/Src/AST/Myc.Ast.Script.pas +++ b/Src/AST/Myc.Ast.Script.pas @@ -233,7 +233,6 @@ type // Helpers function ParseTupleBody(StopToken: TTokenKind): TArray; function ExtractIdentifiers(const Node: IAstNode; const Context: string): TArray; - procedure InitSpecialForms; public constructor Create(const ASource: string); @@ -498,19 +497,6 @@ constructor TParser.Create(const ASource: string); begin inherited Create; FLexer := TLexer.Create(ASource); - InitSpecialForms; - NextToken; -end; - -destructor TParser.Destroy; -begin - FSpecialForms.Free; - FLexer.Free; - inherited; -end; - -procedure TParser.InitSpecialForms; -begin FSpecialForms := TDictionary.Create(TStringComparer.Ordinal); FSpecialForms.Add('if', ParseIf); FSpecialForms.Add('?', ParseCond); @@ -526,6 +512,14 @@ begin FSpecialForms.Add('add-item', ParseAddItem); FSpecialForms.Add('count', ParseCount); FSpecialForms.Add('get', ParseGet); + NextToken; +end; + +destructor TParser.Destroy; +begin + FSpecialForms.Free; + FLexer.Free; + inherited; end; procedure TParser.Error(const Msg: string);