diff --git a/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs b/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs index b71509ebe..43c675f7d 100644 --- a/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs +++ b/source2/Compiler/Cosmos.XSharp/TokenPatterns.cs @@ -97,10 +97,10 @@ namespace Cosmos.Compiler.XSharp { } protected void AddPatterns() { - AddPattern(new TokenType[] { TokenType.LiteralAsm }, + AddPattern("! Move EAX, 0", "new LiteralAssemblerCode(\"{0}\");" ); - AddPattern(new TokenType[] { TokenType.Comment }, + AddPattern("# Comment", "new Comment(\"{0}\");" ); AddPattern("Label:" , @@ -205,20 +205,11 @@ namespace Cosmos.Compiler.XSharp { mPatterns.Add(new TokenPattern(aPattern), aCode); } - protected void AddPattern(TokenType[] aPattern, CodeFunc aCode) { - mPatterns.Add(new TokenPattern(aPattern), aCode); - } - protected void AddPattern(string aPattern, string aCode) { AddPattern(aPattern, delegate(TokenList aTokens, ref List rCode) { rCode.Add(aCode); }); } - protected void AddPattern(TokenType[] aPattern, string aCode) { - AddPattern(aPattern, delegate(TokenList aTokens, ref List rCode) { - rCode.Add(aCode); - }); - } } } diff --git a/source2/Tests/XSharpCompilerTester/Program.cs b/source2/Tests/XSharpCompilerTester/Program.cs index 1f64db954..7e911eb88 100644 --- a/source2/Tests/XSharpCompilerTester/Program.cs +++ b/source2/Tests/XSharpCompilerTester/Program.cs @@ -3,19 +3,13 @@ using System.Collections.Generic; using System.Linq; using System.Windows.Forms; -namespace XSharpCompilerTester -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new MainForm()); - } +namespace XSharpCompilerTester { + static class Program { + [STAThread] + static void Main() { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); } + } }