Author: lluis
Date: 2008-02-05 12:34:23 -0500 (Tue, 05 Feb 2008)
New Revision: 94908
Modified:
trunk/monodevelop/extras/BooBinding/BooLanguageBinding.boo
trunk/monodevelop/extras/BooBinding/ChangeLog
Log:
* BooLanguageBinding.boo: Added trick to support imports defined
outside of a namespace declaration. Fixes bug #358368.
Modified: trunk/monodevelop/extras/BooBinding/BooLanguageBinding.boo
===================================================================
--- trunk/monodevelop/extras/BooBinding/BooLanguageBinding.boo 2008-02-05
17:30:34 UTC (rev 94907)
+++ trunk/monodevelop/extras/BooBinding/BooLanguageBinding.boo 2008-02-05
17:34:23 UTC (rev 94908)
@@ -26,6 +26,7 @@
import System.Reflection
import System.Resources
import System.Xml
+import System.CodeDom
import System.CodeDom.Compiler;
import Boo.Lang.CodeDom;
@@ -38,7 +39,7 @@
public class BooLanguageBinding(IDotNetLanguageBinding):
internal static LanguageName = "Boo"
compilerServices = BooBindingCompilerServices ()
- provider = BooCodeProvider ()
+ provider = BooEnhancedCodeProvider ()
parser = BooBinding.Parser.BooParser ()
public Language as string:
@@ -85,3 +86,19 @@
public Refactorer as IRefactorer:
get:
return null
+
+public class BooEnhancedCodeProvider (BooCodeProvider):
+ public override def CreateGenerator() as ICodeGenerator:
+ return BooEnhancedCodeGenerator ()
+
+public class BooEnhancedCodeGenerator (BooCodeGenerator):
+ public override def GenerateCompileUnit (cu as CodeCompileUnit):
+ // Boo doesn't support more than one namespace in a file.
+ // If the compile unit has a default namespace declaration with
+ // only imports on it, merge it with the main namespace
+ if cu.Namespaces.Count == 2 and cu.Namespaces [0].Name == "":
+ for im in cu.Namespaces[0].Imports:
+ cu.Namespaces[1].Imports.Add (im)
+ cu.Namespaces.RemoveAt (0)
+ super.GenerateCompileUnit (cu)
+
Modified: trunk/monodevelop/extras/BooBinding/ChangeLog
===================================================================
--- trunk/monodevelop/extras/BooBinding/ChangeLog 2008-02-05 17:30:34 UTC
(rev 94907)
+++ trunk/monodevelop/extras/BooBinding/ChangeLog 2008-02-05 17:34:23 UTC
(rev 94908)
@@ -1,5 +1,10 @@
2008-02-05 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+ * BooLanguageBinding.boo: Added trick to support imports defined
outside of
+ a namespace declaration. Fixes bug #358368.
+
+2008-02-05 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
2008-02-05 Lluis Sanchez Gual <[EMAIL PROTECTED]>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches