Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite07f469

Browse files
committed
Changes to bring up F# interactive on Mono profile for .NET 2.0
1 parentffaec53 commite07f469

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎src/fsharp/fsi/fsi.fs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,11 @@ type FsiStdinSyphon(errorWriter: TextWriter) =
320320

321321
/// Clears the syphon text
322322
memberx.Reset()=
323+
#if FX_ATLEAST_40
323324
syphonText.Clear()|> ignore
325+
#else
326+
syphonText.Remove(0,syphonText.Length)|> ignore
327+
#endif
324328

325329
/// Adds a new line to the syphon text
326330
memberx.Add(str:string)=
@@ -433,7 +437,11 @@ type FsiCommandLineOptions(argv: string[], tcConfigB, fsiConsoleOutput: FsiConso
433437
let mutableenableConsoleKeyProcessing=
434438
// Mono on Win32 doesn't implement correct console processing
435439
not(runningOnMono&& System.Environment.OSVersion.Platform= System.PlatformID.Win32NT)
440+
#if MONO
441+
let mutablegui=false// override via "--gui", on by default
442+
#else
436443
let mutablegui=true// override via "--gui", on by default
444+
#endif
437445
#if DEBUG
438446
let mutableshowILCode=false// show modul il code
439447
#endif
@@ -1414,7 +1422,11 @@ module MagicAssemblyResolution =
14141422
// It is an explicit user trust decision to load an assembly with #r. Scripts are not run automatically (for example, by double-clicking in explorer).
14151423
// We considered setting loadFromRemoteSources in fsi.exe.config but this would transitively confer unsafe loading to the code in the referenced
14161424
// assemblies. Better to let those assemblies decide for themselves which is safer.
1425+
#if FX_ATLEAST_40
14171426
Assembly.UnsafeLoadFrom(path)
1427+
#else
1428+
Assembly.LoadFrom(path)
1429+
#endif
14181430
#endif// SILVERLIGHT
14191431
letResolveAssembly(m,tcConfigB,tcImports:TcImports,fsiDynamicCompiler:FsiDynamicCompiler,fsiConsoleOutput:FsiConsoleOutput,fullAssemName:string)=
14201432
try
@@ -1468,9 +1480,11 @@ module MagicAssemblyResolution =
14681480
| Some(OkResult(warns,[r]))-> OkResult(warns, Choice1Of2 r.resolvedPath)
14691481
|_->
14701482

1483+
#if EXTENSIONTYPING
14711484
match tcImports.TryFindProviderGeneratedAssemblyByName(simpleAssemName)with
14721485
| Some(assembly)-> OkResult([],Choice2Of2 assembly)
14731486
| None->
1487+
#endif
14741488

14751489
// Try to find the reference without an extension
14761490
match tcImports.TryFindExistingFullyQualifiedPathFromAssemblyRef(ILAssemblyRef.Create(simpleAssemName,None,None,false,None,None))with
@@ -2233,9 +2247,11 @@ type internal FsiEvaluationSession (argv:string[], inReader:TextReader, outWrite
22332247

22342248
#if SILVERLIGHT
22352249
#else
2250+
#if FX_ATLEAST_40
22362251
// set platform depending on whether the current process is a 64-bit process.
22372252
// BUG 429882 : FsiAnyCPU.exe issues warnings (x64 v MSIL) when referencing 64-bit assemblies
22382253
do tcConfigB.platform<-if System.Environment.Is64BitProcessthen Some AMD64else Some X86
2254+
#endif
22392255
#endif
22402256

22412257
letfsiStdinSyphon=new FsiStdinSyphon(errorWriter)
@@ -2339,9 +2355,11 @@ type internal FsiEvaluationSession (argv:string[], inReader:TextReader, outWrite
23392355

23402356
#else
23412357
letresolveType _fsiDynamicCompiler(aref:ILAssemblyRef)=
2358+
#if EXTENSIONTYPING
23422359
match tcImports.TryFindProviderGeneratedAssemblyByName aref.Namewith
23432360
| Some assembly-> Some(Choice2Of2 assembly)
23442361
| None->
2362+
#endif
23452363
match tcImports.TryFindExistingFullyQualifiedPathFromAssemblyRef arefwith
23462364
| Some resolvedPath-> Some(Choice1Of2 resolvedPath)
23472365
| None-> None

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp