diff options
author | Lluis Sanchez <lluis@novell.com> | 2008-02-05 20:46:37 +0300 |
---|---|---|
committer | Lluis Sanchez <lluis@novell.com> | 2008-02-05 20:46:37 +0300 |
commit | af98874d74bb2bac49418d8d0ee82db3f3f7c245 (patch) | |
tree | d4dfc84b0fdb9ec2e075a2bb97f50581df709d4c | |
parent | efdb3e475226f75b4f64528124f75bbf3df3240a (diff) |
* BooLanguageBinding.boo: Added trick to support imports defined outside ofextras/BooBinding/0.19
a namespace declaration. Fixes bug #358368.
2008-02-05 Lluis Sanchez Gual <lluis@novell.com>
svn path=/branches/monodevelop/extras/BooBinding/1.0/; revision=94911
-rw-r--r-- | extras/BooBinding/BooLanguageBinding.boo | 19 | ||||
-rw-r--r-- | extras/BooBinding/ChangeLog | 5 |
2 files changed, 23 insertions, 1 deletions
diff --git a/extras/BooBinding/BooLanguageBinding.boo b/extras/BooBinding/BooLanguageBinding.boo index 16470ea89f..a1a92c1c8c 100644 --- a/extras/BooBinding/BooLanguageBinding.boo +++ b/extras/BooBinding/BooLanguageBinding.boo @@ -26,6 +26,7 @@ import System.Collections import System.Reflection import System.Resources import System.Xml +import System.CodeDom import System.CodeDom.Compiler; import Boo.Lang.CodeDom; @@ -38,7 +39,7 @@ import MonoDevelop.Core 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 class BooLanguageBinding(IDotNetLanguageBinding): 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) + diff --git a/extras/BooBinding/ChangeLog b/extras/BooBinding/ChangeLog index 9225ebe8ae..cf58140be8 100644 --- a/extras/BooBinding/ChangeLog +++ b/extras/BooBinding/ChangeLog @@ -1,5 +1,10 @@ 2008-02-05 Lluis Sanchez Gual <lluis@novell.com> + * BooLanguageBinding.boo: Added trick to support imports defined outside of + a namespace declaration. Fixes bug #358368. + +2008-02-05 Lluis Sanchez Gual <lluis@novell.com> + 2008-02-05 Lluis Sanchez Gual <lluis@novell.com> |