From cff5ec430bba80d072a66672f01c1a37f485bb4f Mon Sep 17 00:00:00 2001 From: jackfiled Date: Sun, 12 May 2024 22:36:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=89=8D=E7=AB=AF=E7=9A=84=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E8=BE=93=E5=87=BA=20(#81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.rrricardo.top/PostGuard/Canon/pulls/81 --- Canon.Core/SemanticParser/CodeGeneratorVisitor.cs | 3 ++- Canon.Server/Services/CompilerService.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Canon.Core/SemanticParser/CodeGeneratorVisitor.cs b/Canon.Core/SemanticParser/CodeGeneratorVisitor.cs index 8cb048c..3e58f1c 100644 --- a/Canon.Core/SemanticParser/CodeGeneratorVisitor.cs +++ b/Canon.Core/SemanticParser/CodeGeneratorVisitor.cs @@ -1,4 +1,5 @@ using System.Globalization; +using Canon.Core.Abstractions; using Canon.Core.CodeGenerators; using Canon.Core.Enums; using Canon.Core.GrammarParser; @@ -9,7 +10,7 @@ using Expression = Canon.Core.SyntaxNodes.Expression; namespace Canon.Core.SemanticParser; -public class CodeGeneratorVisitor : TypeCheckVisitor +public class CodeGeneratorVisitor(ICompilerLogger? logger = null) : TypeCheckVisitor(logger) { public CCodeBuilder Builder { get; } = new(); diff --git a/Canon.Server/Services/CompilerService.cs b/Canon.Server/Services/CompilerService.cs index dbb5de9..d469961 100644 --- a/Canon.Server/Services/CompilerService.cs +++ b/Canon.Server/Services/CompilerService.cs @@ -40,7 +40,7 @@ public class CompilerService( await using Stream imageStream = syntaxTreePresentationService.Present(root); string filename = await gridFsService.UploadStream(imageStream, "image/png"); - CodeGeneratorVisitor visitor = new(); + CodeGeneratorVisitor visitor = new(compilerLogger); traveller.Travel(root, visitor); CompileResult result = new()