@@ -30,10 +30,10 @@ internal set
3030 private string ? Input = null ;
3131 public enum EZInputType { Console , InputMethod }
3232 public EZInputType InputType { get ; set ; } = EZInputType . Console ;
33- public void SetInput ( string input , EZInputType inputType = EZInputType . InputMethod )
33+ public void SetInput ( string input , EZInputType inputType = EZInputType . InputMethod )
3434 {
3535 InputType = inputType ;
36- Input = input ;
36+ Input = input ;
3737 }
3838 public string ConsoleInput ( )
3939 {
@@ -104,6 +104,8 @@ public Interpreter(Parser parser, Debug.Breakpoint[]? breakpoints = null)
104104 private DataType ? Returning = null ;
105105 private int StackNumber = 0 ;
106106 public Stack < string > StackTrace { get ; private set ; }
107+ internal record Library ( string name , string [ ] files ) ;
108+ internal List < Library > DllLibraries { get ; set ; } = [ ] ;
107109 public Exception [ ] Errors { get ; private set ; } = [ ] ;
108110 public Var [ ] Vars { get ; set ; } = [ ] ;
109111 public Method [ ] Methods { get ; set ; } = [ ] ;
@@ -114,7 +116,6 @@ public Interpreter(Parser parser, Debug.Breakpoint[]? breakpoints = null)
114116 public void Interperate ( ) => Interperate ( parser . LinesWithTokens ) ;
115117 public void Interperate ( LineWithTokens [ ] LineTokens )
116118 {
117- int endcode = 0 ;
118119 var temp_stack = new Stack < string > ( StackTrace ) ;
119120
120121 Package . RemoveAllPackagesFromExecutionDirectory ( AppDomain . CurrentDomain . BaseDirectory ) ;
@@ -192,13 +193,19 @@ public void Interperate(LineWithTokens[] LineTokens)
192193
193194 if ( projects . Any ( x => ! string . IsNullOrEmpty ( x . LibraryDirectory ) ) )
194195 {
195- string destination = Path . Combine ( AppDomain . CurrentDomain . BaseDirectory , "Libraries" ) ;
196+ string destination = AppDomain . CurrentDomain . BaseDirectory ;
196197 foreach ( var project in projects )
197198 {
198199 if ( FirstToken . StringValue == "include" )
199- Package . AddPackageToExecutionDirectory ( project , destination ) ;
200- else
201- Package . RemovePackageFromExecutionDirectory ( project , destination ) ;
200+ {
201+ Package . AddPackageToExecutionDirectory ( project , destination , out var files ) ;
202+ DllLibraries . Add ( new Library ( project . Name , files ) ) ;
203+ }
204+ else
205+ {
206+ var library = DllLibraries . FirstOrDefault ( x => x . name == project . Name ) ;
207+ Package . RemovePackageFromExecutionDirectory ( library . files ) ;
208+ }
202209 }
203210 }
204211
@@ -1294,7 +1301,7 @@ public object Reflect(CSharpMethod method)
12941301 }
12951302 public static object ? InvokeMethod ( string methodPath , object [ ] parameters , EZHelp e )
12961303 {
1297- // Split the method path into type and method name
1304+ // Split the method files into type and method name
12981305 string [ ] pathParts = methodPath . Split ( '.' ) ;
12991306 if ( pathParts . Length < 2 )
13001307 {
@@ -1303,10 +1310,10 @@ public object Reflect(CSharpMethod method)
13031310
13041311 if ( pathParts . Length >= 2 && pathParts [ 1 ] . Equals ( "dll" ) )
13051312 {
1306- // If the method path contains an assembly name, load the assembly
1313+ // If the method files contains an assembly name, load the assembly
13071314 string assemblyPath = pathParts [ 0 ] + "." + pathParts [ 1 ] ;
1308- string subdirectory = pathParts [ 0 ] ; // Name of the subdirectory is first part of namespace
1309- string fullAssemblyPath = Path . Combine ( subdirectory , assemblyPath ) ; // Combine subdirectory path with assembly name
1315+ string subdirectory = Package . LibraryDirName ; // Name of the subdirectory is first part of namespace
1316+ string fullAssemblyPath = Path . Combine ( subdirectory , assemblyPath ) ; // Combine subdirectory files with assembly name
13101317 Assembly assembly = Assembly . LoadFrom ( fullAssemblyPath ) ;
13111318
13121319 // Get the type name
@@ -1361,7 +1368,7 @@ public object Reflect(CSharpMethod method)
13611368 throw new ArgumentException ( $ "Type \" { typeName } \" not found") ;
13621369 }
13631370
1364- // Get the method name from the path
1371+ // Get the method name from the files
13651372 string methodName = pathParts . Last ( ) ;
13661373
13671374 // Find the method in the type
0 commit comments