diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-09-05 10:20:03 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2025-09-05 10:20:03 +1000 |
| commit | 9e8ba6e00dc4a4137a5187dbe5fe5b1394219735 (patch) | |
| tree | e5a54706a8a85243fdb0fe0f2ed73fb7b7566bcd /Compiler.Testing/TestingHelpers.cs | |
| parent | 4ea967c6089bbcaba5d71145546d288e186fba40 (diff) | |
stuff
Diffstat (limited to 'Compiler.Testing/TestingHelpers.cs')
| -rw-r--r-- | Compiler.Testing/TestingHelpers.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Compiler.Testing/TestingHelpers.cs b/Compiler.Testing/TestingHelpers.cs new file mode 100644 index 0000000..a3d85fe --- /dev/null +++ b/Compiler.Testing/TestingHelpers.cs @@ -0,0 +1,14 @@ +namespace Compiler.Testing; + +using Antlr4.Runtime; +using Q1.Compiler; + +public class TestingHelpers +{ + public static string CompileString(string input) + { + CompilerOptions options = new() { CommentCompilationMode = CommentCompilationMode.None }; + IEnumerable<string> lines = Program.Compile(options, new AntlrInputStream(input)); + return Program.Optimize(lines); + } +}
\ No newline at end of file |
