Browse Source

Weird fix for a weird problem involving properties in extensions...

Mark Sibly 8 years ago
parent
commit
b530a40aaf
2 changed files with 9 additions and 7 deletions
  1. 2 2
      src/mx2cc/mx2cc.monkey2
  2. 7 5
      src/mx2cc/nodefinder.monkey2

+ 2 - 2
src/mx2cc/mx2cc.monkey2

@@ -25,13 +25,13 @@ Const FORCE_MSVC:=False
 
 Global StartDir:String
 
-'Const TestArgs:="mx2cc makemods"
+Const TestArgs:="mx2cc makemods"
 
 'Const TestArgs:="mx2cc makemods -clean monkey"
 
 'Const TestArgs:="mx2cc makemods -config=debug monkey libc miniz stb-image stb-image-write stb-vorbis std"
 
-Const TestArgs:="mx2cc makeapp -target=desktop -apptype=console -run src/mx2cc/test.monkey2"
+'Const TestArgs:="mx2cc makeapp -target=desktop -apptype=console -run src/mx2cc/test.monkey2"
 
 'To build with old mx2cc...
 '

+ 7 - 5
src/mx2cc/nodefinder.monkey2

@@ -17,14 +17,15 @@ Class NodeFinder
 	
 	Method Add( node:SNode )
 		
-		If Not node Return
+		If Not node Or node=Self.node Return
 		
 		If Not Self.node
 			Self.node=node
 			Return
 		Endif
-			
-		Local flist:=Cast<FuncList>( node )
+		
+		Local flist:FuncList
+		If Not Cast<PropertyList>( node ) flist=Cast<FuncList>( node )
 			
 		If Self.flist
 			
@@ -34,7 +35,9 @@ Class NodeFinder
 				
 		Else If flist
 			
-			Local src:=Cast<FuncList>( Self.node )
+			Local src:FuncList
+			If Not Cast<PropertyList>( Self.node ) src=Cast<FuncList>( Self.node )
+			
 			If Not src Throw New SemantEx( "Duplicate identifier '"+ident+"'" )
 				
 			Local dst:=New FuncList( ident,Null )
@@ -48,7 +51,6 @@ Class NodeFinder
 		Else
 	
 			Throw New SemantEx( "Duplicate identifier '"+ident+"'" )
-			
 		End
 	End