From 262dd0ed1bf000a50a86a3edafb471984f59b150 Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Thu, 1 Feb 2024 11:46:13 +0800 Subject: [PATCH] feat(csharp): add support for conditional compilation Add support for conditional compilation in the CSharpAstListenerTest class. This allows for different code blocks to be compiled based on the DEBUG flag. --- .../kotlin/chapi/ast/csharpast/CSharpAstListenerTest.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/chapi-ast-csharp/src/test/kotlin/chapi/ast/csharpast/CSharpAstListenerTest.kt b/chapi-ast-csharp/src/test/kotlin/chapi/ast/csharpast/CSharpAstListenerTest.kt index 3d41ec91..5db6cde0 100644 --- a/chapi-ast-csharp/src/test/kotlin/chapi/ast/csharpast/CSharpAstListenerTest.kt +++ b/chapi-ast-csharp/src/test/kotlin/chapi/ast/csharpast/CSharpAstListenerTest.kt @@ -342,15 +342,14 @@ namespace Chapi { val code = """ using System.Text; namespace testns { - public class testcls { + #if DEBUG + public class testcls { public static void Main(string []args) { - #if DEBUG int x = 2; - #else int y = 10; - #endif } } + #endif }""" val codeContainer = CSharpAnalyser().analysis(code, "test.cs") val structs = codeContainer.Containers[0].DataStructures