-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathProgram.cs
More file actions
34 lines (29 loc) · 1.02 KB
/
Copy pathProgram.cs
File metadata and controls
34 lines (29 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System;
using System.IO;
using Platform.RegularExpressions.Transformer.CSharpToCpp;
class Program
{
static void Main()
{
string inputCode = @"// Test cases for readonly transformations
public class TestClass
{
// Test string readonly
public static readonly string ExceptionContentsSeparator = ""---"";
private static readonly string PrivateMessage = ""error"";
// Test other types readonly
public static readonly int MaxPath = 92;
private static readonly bool IsEnabled = true;
// Test const (should already work)
private const int ConstValue = 42;
public const string ConstString = ""test"";
}";
Console.WriteLine("Original code:");
Console.WriteLine(inputCode);
Console.WriteLine("\n" + new string('=', 50) + "\n");
var transformer = new CSharpToCppTransformer();
string transformed = transformer.Transform(inputCode);
Console.WriteLine("Transformed code:");
Console.WriteLine(transformed);
}
}