Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 24.92 KB | None | 0 0
  1. // (c) Microsoft Corporation. All rights reserved
  2. #light
  3.  
  4. /// Loading initial context, reporting errors etc.
  5. module internal Microsoft.FSharp.Compiler.Build
  6.  
  7. open System.Text
  8. open Internal.Utilities
  9. open Microsoft.FSharp.Compiler.AbstractIL
  10. open Microsoft.FSharp.Compiler.AbstractIL.IL
  11. open Microsoft.FSharp.Compiler.AbstractIL.Internal
  12. open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
  13. open Microsoft.FSharp.Compiler
  14.  
  15. module Tc = Microsoft.FSharp.Compiler.TypeChecker
  16.  
  17. open Microsoft.FSharp.Compiler.Range
  18. open Microsoft.FSharp.Compiler.Ast
  19. open Microsoft.FSharp.Compiler.ErrorLogger
  20. open Microsoft.FSharp.Compiler.Tast
  21. open Microsoft.FSharp.Compiler.Tastops
  22. open Microsoft.FSharp.Compiler.Lib
  23. open Microsoft.FSharp.Compiler.Infos
  24. open Microsoft.FSharp.Compiler.MSBuildResolver
  25. open Tc
  26. open Microsoft.FSharp.Compiler.Env
  27.  
  28.  
  29.  
  30. #if DEBUG
  31. val internal showAssertForUnexpectedException : bool ref
  32. #endif
  33.  
  34. /// Signature file suffixes
  35. val public sigSuffixes : string list
  36.  
  37. /// Implementation file suffixes
  38. val public implSuffixes : string list
  39.  
  40. /// Script file suffixes
  41. val public scriptSuffixes : string list
  42.  
  43. val public IsScript : string -> bool
  44.  
  45. val public IsInvalidPath : string -> bool
  46.  
  47. /// File suffixes where #light is the default
  48. val internal lightSyntaxDefaultExtensions : string list
  49.  
  50. //----------------------------------------------------------------------------
  51. // Parsing inputs
  52. //--------------------------------------------------------------------------
  53.  
  54. val public QualFileNameOfUniquePath : range * string list -> Ast.QualifiedNameOfFile
  55.  
  56. val public PrependPathToInput : Ast.ident list -> Ast.Input -> Ast.Input
  57.  
  58. val internal ParseInput : (UnicodeLexing.Lexbuf -> Parser.token) * ErrorLogger * UnicodeLexing.Lexbuf * string option * string * isLastCompiland: bool -> Ast.Input
  59.  
  60.  
  61.  
  62. //----------------------------------------------------------------------------
  63. // Errors
  64. //--------------------------------------------------------------------------
  65.  
  66. type ErrorStyle =
  67.     | DefaultErrors
  68.     | EmacsErrors
  69.     | TestErrors
  70.     | VSErrors
  71.    
  72.  
  73. val internal RangeOfError : PhasedError -> range option
  74. val internal SplitRelatedErrors : PhasedError -> PhasedError * PhasedError list
  75. val public OutputPhasedError : StringBuilder -> PhasedError -> bool -> unit
  76. val public SanitizeFileName : filename:string -> implicitIncludeDir:string -> string
  77. val public OutputErrorOrWarning : implicitIncludeDir:string * showFullPaths: bool * flattenErrors: bool * errorStyle: ErrorStyle *  warning:bool -> StringBuilder -> PhasedError -> unit
  78. val public OutputErrorOrWarningContext : prefix:string -> fileLineFunction:(string -> int -> string) -> StringBuilder -> PhasedError -> unit
  79.  
  80.  
  81. //----------------------------------------------------------------------------
  82. // Options and configuration
  83. //--------------------------------------------------------------------------
  84.  
  85. // For command-line options that can be suffixed with +/-
  86. type public OptionSwitch =
  87.     | On
  88.     | Off
  89.  
  90. /// The spec value describes the action of the argument,
  91. /// and whether it expects a following parameter.
  92. type OptionSpec =
  93.     | OptionClear of bool ref
  94.     | OptionFloat of (float -> unit)
  95.     | OptionInt of (int -> unit)
  96.     | OptionSwitch of (OptionSwitch -> unit)
  97.     | OptionIntList of (int -> unit)
  98.     | OptionIntListSwitch of (int -> OptionSwitch -> unit)
  99.     | OptionRest of (string -> unit)
  100.     | OptionSet of bool ref
  101.     | OptionString of (string -> unit)
  102.     | OptionStringList of (string -> unit)
  103.     | OptionStringListSwitch of (string -> OptionSwitch -> unit)
  104.     | OptionUnit of (unit -> unit)
  105.     | OptionHelp of (CompilerOptionBlock list -> unit)                      // like OptionUnit, but given the "options"
  106.     | OptionGeneral of (string list -> bool) * (string list -> string list) // Applies? * (ApplyReturningResidualArgs)
  107. and  CompilerOption      = CompilerOption of string * string * OptionSpec * Option<exn> * string option
  108. and  CompilerOptionBlock = PublicOptions  of string * CompilerOption list | PrivateOptions of CompilerOption list
  109.  
  110. val printCompilerOptionBlocks : CompilerOptionBlock list -> unit  // for printing usage
  111. val dumpCompilerOptionBlocks  : CompilerOptionBlock list -> unit  // for QA
  112. val filterCompilerOptionBlock : (CompilerOption -> bool) -> CompilerOptionBlock -> CompilerOptionBlock
  113.  
  114. exception public AssemblyNotResolved of (*originalName*) string * range
  115. exception public FileNameNotResolved of (*filename*) string * (*description of searched locations*) string * range
  116. exception public DeprecatedCommandLineOptionFull of string * range
  117. exception public DeprecatedCommandLineOptionForHtmlDoc of string * range
  118. exception public DeprecatedCommandLineOptionSuggestAlternative of string * string * range
  119. exception public DeprecatedCommandLineOptionNoDescription of string * range
  120. exception HashLoadedSourceHasIssues of (*warnings*) exn list * (*errors*) exn list * range
  121. exception HashLoadedScriptConsideredSource of range  
  122.  
  123. type AssemblyReference =
  124.     | AssemblyReference of range * string
  125.     member Range : range
  126.     member Text : string
  127.  
  128. type AssemblyResolution = {
  129.     /// The original reference to the assembly.
  130.     originalReference : AssemblyReference
  131.     /// Path to the resolvedFile
  132.     resolvedPath : string    
  133.     /// Search path used to find this spot.
  134.     resolvedFrom : ResolvedFrom
  135.     /// Long fusion name of the assembly
  136.     fusionName : string
  137.     /// Version of the assembly like 4.0.0.0
  138.     fusionVersion : string
  139.     /// Name of the redist, if any, that the assembly was found in.
  140.     redist : string
  141.     /// Whether or not this is an installed system assembly (for example, System.dll)
  142.     sysdir : bool
  143.     }
  144.    
  145. type target =
  146.     | WinExe
  147.     | ConsoleExe
  148.     | Dll
  149.     | Module
  150.     member IsExe : bool
  151.    
  152. type ResolveLibFileMode =
  153.     | Speculative
  154.     | ReportErrors
  155.  
  156. type VersionFlag =
  157.     | VersionString of string
  158.     | VersionFile of string
  159.     | VersionNone
  160.     member GetVersionInfo : (*implicitIncludeDir:*)string -> ILVersionInfo
  161.     member GetVersionString : (*implicitIncludeDir:*)string -> string
  162.          
  163.      
  164. type public TcConfigBuilder =
  165.     { mutable mscorlibAssemblyName: string;
  166.       mutable autoResolveOpenDirectivesToDlls: bool;
  167.       mutable noFeedback: bool;
  168.       mutable stackReserveSize: int32 option;
  169.       mutable implicitIncludeDir: string;
  170.       mutable openBinariesInMemory: bool;
  171.       mutable openDebugInformationForLaterStaticLinking: bool;
  172.       defaultFSharpBinariesDir: string;
  173.       mutable compilingFslib: bool;
  174.       mutable compilingFslibPre40: string option;
  175.       mutable useIncrementalBuilder: bool;
  176.       mutable includes: string list;
  177.       mutable implicitOpens: string list;
  178.       mutable useFsiAuxLib: bool;
  179.       mutable framework: bool;
  180.       mutable resolutionEnvironment : ResolutionEnvironment
  181.       mutable implicitlyResolveAssemblies : bool
  182.       /// Set if the user has explicitly turned indentation-aware syntax on/off
  183.       mutable light: bool option;
  184.       mutable conditionalCompilationDefines: string list;
  185.       /// Sources added into the build with #load
  186.       mutable loadedSources: (range * string) list;
  187.      
  188.       mutable referencedDLLs: AssemblyReference  list;
  189.       optimizeForMemory: bool;
  190.       mutable inputCodePage: int option;
  191.       mutable embedResources : string list;
  192.       mutable globalWarnAsError: bool;
  193.       mutable globalWarnLevel: int;
  194.       mutable specificWarnOff: int list;
  195.       mutable specificWarnOn: int list;
  196.       mutable specificWarnAsError: int list
  197.       mutable specificWarnAsWarn : int list
  198.       mutable mlCompatibility:bool;
  199.       mutable checkOverflow:bool;
  200.       mutable showReferenceResolutions:bool;
  201.       mutable outputFile : string option;
  202.       mutable resolutionFrameworkRegistryBase : string;
  203.       mutable resolutionAssemblyFoldersSuffix : string;
  204.       mutable resolutionAssemblyFoldersConditions : string;          
  205.       mutable platform : ILPlatform option
  206.       mutable useMonoResolution : bool
  207.       mutable target : target
  208.       mutable debuginfo : bool
  209.       mutable testFlagEmitFeeFeeAs100001 : bool
  210.       mutable debugSymbolFile : string option
  211.       mutable typeCheckOnly : bool
  212.       mutable parseOnly : bool
  213.       mutable simulateException : string option
  214.       mutable printAst : bool
  215.       mutable tokenizeOnly : bool
  216.       mutable testInteractionParser : bool
  217.       mutable reportNumDecls : bool
  218.       mutable printSignature : bool
  219.       mutable printSignatureFile : string
  220.       mutable xmlDocOutputFile : string option
  221.       mutable generateHtmlDocs : bool
  222.       mutable htmlDocDirectory : string option
  223.       mutable htmlDocCssFile : string option
  224.       mutable htmlDocNamespaceFile : string option
  225.       mutable htmlDocAppendFlag : bool
  226.       mutable htmlDocLocalLinks : bool  
  227.       mutable stats : bool
  228.       mutable generateFilterBlocks : bool
  229.       mutable signer : string option
  230.       mutable container : string option
  231.       mutable delaysign : bool
  232.       mutable version : VersionFlag
  233.       mutable metadataVersion : string option
  234.       mutable standalone : bool
  235.       mutable extraStaticLinkRoots : string list
  236.       mutable noSignatureData : bool
  237.       mutable onlyEssentialOptimizationData : bool
  238.       mutable useOptimizationDataFile : bool
  239.       mutable useSignatureDataFile : bool
  240.       mutable jitTracking : bool
  241.       mutable ignoreSymbolStoreSequencePoints : bool
  242.       mutable internConstantStrings : bool
  243.       mutable extraOptimizationIterations : int
  244.       mutable win32res : string
  245.       mutable win32manifest : string
  246.       mutable includewin32manifest : bool
  247.       mutable linkResources : string list
  248.       mutable showFullPaths : bool
  249.       mutable errorStyle : ErrorStyle
  250.       mutable utf8output : bool
  251.       mutable flatErrors : bool
  252.       mutable maxErrors : int
  253.       mutable abortOnError : bool
  254.       mutable baseAddress : int32 option
  255.  #if DEBUG
  256.       mutable writeGeneratedILFiles : bool (* write il files? *)  
  257.       mutable showOptimizationData : bool
  258. #endif
  259.       mutable showTerms     : bool
  260.       mutable writeTermsToFiles : bool
  261.       mutable doDetuple     : bool
  262.       mutable doTLR         : bool
  263.       mutable doFinalSimplify : bool
  264.       mutable optsOn        : bool
  265.       mutable optSettings   : Opt.OptimizationSettings
  266.       mutable product : string
  267.       mutable showBanner  : bool
  268.       mutable showTimes : bool
  269.       mutable pause : bool }
  270.     static member CreateNew : string * bool * string  -> TcConfigBuilder
  271.     member DecideNames : string list -> (*outfile*)string * (*pdbfile*)string option * (*assemblyName*)string
  272.     member TurnWarningOff : range * string -> unit
  273.     member TurnWarningOn : range * string -> unit
  274.     member AddIncludePath : range * string -> unit
  275.     member AddReferencedAssemblyByPath : range * string -> unit
  276.     member AddLoadedSource : range * string -> unit
  277.     member AddEmbeddedResource : string -> unit
  278.    
  279.     static member SplitCommandLineResourceInfo : string -> string * string * ILResourceAccess
  280.  
  281.  
  282.    
  283. [<Sealed>]
  284. // Immutable TcConfig
  285. type public TcConfig =
  286.     member mscorlibAssemblyName: string;
  287.     member autoResolveOpenDirectivesToDlls: bool;
  288.     member noFeedback: bool;
  289.     member stackReserveSize: int32 option;
  290.     member implicitIncludeDir: string;
  291.     member openBinariesInMemory: bool;
  292.     member openDebugInformationForLaterStaticLinking: bool;
  293.     member fsharpBinariesDir: string;
  294.     member compilingFslib: bool;
  295.     member compilingFslibPre40: string option;
  296.     member useIncrementalBuilder: bool;
  297.     member includes: string list;
  298.     member implicitOpens: string list;
  299.     member useFsiAuxLib: bool;
  300.     member framework: bool;
  301.     member implicitlyResolveAssemblies : bool
  302.     /// Set if the user has explicitly turned indentation-aware syntax on/off
  303.     member light: bool option;
  304.     member conditionalCompilationDefines: string list;
  305.     /// Sources added into the build with #load
  306.     member loadedSources: (range * string) list;
  307.    
  308.     member referencedDLLs: AssemblyReference list;
  309.     member optimizeForMemory: bool;
  310.     member inputCodePage: int option;
  311.     member embedResources : string list;
  312.     member globalWarnAsError: bool;
  313.     member globalWarnLevel: int;
  314.     member specificWarnOn: int list;
  315.     member specificWarnOff: int list;
  316.     member specificWarnAsError: int list
  317.     member specificWarnAsWarn : int list
  318.     member mlCompatibility:bool;
  319.     member checkOverflow:bool;
  320.     member showReferenceResolutions:bool;
  321.     member outputFile : string option;
  322.     member resolutionFrameworkRegistryBase : string;
  323.     member resolutionAssemblyFoldersSuffix : string;
  324.     member resolutionAssemblyFoldersConditions : string;          
  325.     member platform : ILPlatform option
  326.     member useMonoResolution : bool
  327.     member target : target
  328.     member debuginfo : bool
  329.     member testFlagEmitFeeFeeAs100001 : bool
  330.     member debugSymbolFile : string option
  331.     member typeCheckOnly : bool
  332.     member parseOnly : bool
  333.     member simulateException : string option
  334.     member printAst : bool
  335.     member tokenizeOnly : bool
  336.     member testInteractionParser : bool
  337.     member reportNumDecls : bool
  338.     member printSignature : bool
  339.     member printSignatureFile : string
  340.     member xmlDocOutputFile : string option
  341.     member generateHtmlDocs : bool
  342.     member htmlDocDirectory : string option
  343.     member htmlDocCssFile : string option
  344.     member htmlDocNamespaceFile : string option
  345.     member htmlDocAppendFlag : bool
  346.     member htmlDocLocalLinks : bool  
  347.     member stats : bool
  348.     member generateFilterBlocks : bool
  349.     member signer : string option
  350.     member container : string option
  351.     member delaysign : bool
  352.     member version : VersionFlag
  353.     member metadataVersion : string option
  354.     member standalone : bool
  355.     member extraStaticLinkRoots : string list
  356.     member noSignatureData : bool
  357.     member onlyEssentialOptimizationData : bool
  358.     member useOptimizationDataFile : bool
  359.     member useSignatureDataFile : bool
  360.     member jitTracking : bool
  361.     member ignoreSymbolStoreSequencePoints : bool
  362.     member internConstantStrings : bool
  363.     member extraOptimizationIterations : int
  364.     member win32res : string
  365.     member win32manifest : string
  366.     member includewin32manifest : bool
  367.     member linkResources : string list
  368.     member showFullPaths : bool
  369.     member errorStyle : ErrorStyle
  370.     member utf8output : bool
  371.     member flatErrors : bool
  372.  
  373.     member maxErrors : int
  374.     member baseAddress : int32 option
  375. #if DEBUG
  376.     member writeGeneratedILFiles : bool (* write il files? *)  
  377.     member showOptimizationData : bool
  378. #endif
  379.     member showTerms     : bool
  380.     member writeTermsToFiles : bool
  381.     member doDetuple     : bool
  382.     member doTLR         : bool
  383.     member doFinalSimplify : bool
  384.     member optSettings   : Opt.OptimizationSettings
  385.     member optsOn        : bool
  386.     member product : string
  387.     member showBanner  : bool
  388.     member showTimes : bool
  389.     member pause : bool
  390.  
  391.  
  392.     member ComputeLightSyntaxInitialStatus : string -> bool
  393.     member ClrRoot : string list
  394.    
  395.     /// Get the loaded sources that exist and issue a warning for the ones that don't
  396.     member GetAvailableLoadedSources : unit -> (range*string) list
  397.    
  398.     member ComputeCanContainEntryPoint : sourceFiles:string list -> bool list
  399.  
  400.     /// File system query based on TcConfig settings
  401.     member ResolveSourceFile : range * string -> string
  402.     /// File system query based on TcConfig settings
  403.     member MakePathAbsolute : string -> string
  404.     static member Create : TcConfigBuilder * validate: bool -> TcConfig
  405.    
  406.  
  407.  
  408. //----------------------------------------------------------------------------
  409. // Tables of referenced DLLs
  410. //--------------------------------------------------------------------------
  411.  
  412. type public ImportedBinary =
  413.     { FileName: string;
  414.       IsFSharpBinary: bool;
  415.       RawMetadata: ILModuleDef;
  416.       ILAssemblyRefs : ILAssemblyRef list;
  417.       ILScopeRef: ILScopeRef ;}
  418.  
  419. type public ImportedAssembly =
  420.     { ILScopeRef: ILScopeRef;
  421.       FSharpViewOfMetadata: CcuThunk;
  422.       AssemblyAutoOpenAttributes: string list;
  423.       AssemblyInternalsVisibleToAttributes: string list;
  424.       FSharpOptimizationData : Lazy<Option<Opt.LazyModuleInfo>> }
  425.  
  426. type UnresolvedReference = UnresolvedReference of string * AssemblyReference list
  427.  
  428. [<Sealed>]
  429. type TcAssemblyResolutions =
  430.     member GetAssemblyResolutions : unit -> AssemblyResolution list
  431.  
  432.     static member SplitNonFoundationalResolutions  : TcConfig -> AssemblyResolution list * AssemblyResolution list * UnresolvedReference list
  433.     static member BuildFromPriorResolutions     : TcConfig * AssemblyResolution list -> TcAssemblyResolutions
  434.    
  435.  
  436. [<Sealed>]
  437. type TcConfigProvider =
  438.     static member Constant : TcConfig -> TcConfigProvider
  439.     static member BasedOnMutableBuilder : TcConfigBuilder -> TcConfigProvider
  440.  
  441. [<Sealed>]
  442. type TcImports =
  443.     interface System.IDisposable
  444.     //new : TcImports option -> TcImports
  445.     member SetBase : TcImports -> unit
  446.     member DllTable : NameMap<ImportedBinary> with get
  447.     member GetCcuInfos : unit -> ImportedAssembly list
  448.     member GetCcusInDeclOrder : unit -> CcuThunk list
  449.     member FindDllInfo : range * string -> ImportedBinary
  450.     member TryFindDllInfo : range * string -> option<ImportedBinary>
  451.     member FindCcuFromAssemblyRef : range * ILAssemblyRef -> Tast.CcuResolutionResult
  452.     member AssemblyLoader : Import.AssemblyLoader
  453.     member GetImportMap : unit -> Import.ImportMap
  454.  
  455.     /// File system query based on TcConfig settings
  456.     member TryResolveLibFile : AssemblyReference * ResolveLibFileMode -> OperationResult<AssemblyResolution>
  457.     /// File system query based on TcConfig settings
  458.     member ResolveLibFile : AssemblyReference * ResolveLibFileMode -> AssemblyResolution
  459.  
  460.     static member BuildFrameworkTcImports      : TcConfigProvider * AssemblyResolution list -> TcGlobals * TcImports
  461.     static member BuildNonFrameworkTcImports   : TcConfigProvider * TcGlobals * TcImports * AssemblyResolution list -> TcImports
  462.     static member BuildTcImports               : TcConfigProvider -> TcGlobals * TcImports
  463.  
  464. //----------------------------------------------------------------------------
  465. // Special resources in DLLs
  466. //--------------------------------------------------------------------------
  467.  
  468. val public  IsSignatureDataResource : ILResource -> bool
  469. val public IsOptDataResource : ILResource -> bool
  470. val public IsReflectedDefinitionsResource : ILResource -> bool
  471.  
  472. val public WriteSignatureData : TcConfig * TcGlobals * Tastops.Remap * CcuThunk * string -> ILResource
  473. val public WriteOptData :  TcGlobals -> string -> CcuThunk * Opt.LazyModuleInfo -> ILResource
  474.  
  475. //----------------------------------------------------------------------------
  476. //
  477. //--------------------------------------------------------------------------
  478.  
  479.  
  480. val public GetNameOfScopeRef : ILScopeRef -> string
  481. val public GetNameOfILModule : ILModuleDef -> string
  482.  
  483. val public GetFSharpCoreLibraryName : unit -> string
  484. val public GetFSharpPowerPackLibraryName : unit -> string
  485.  
  486. //----------------------------------------------------------------------------
  487. // Finding and requiring DLLs
  488. //--------------------------------------------------------------------------
  489.  
  490. val public RequireDLL : TcImports -> tcEnv -> range -> string -> tcEnv * (ImportedBinary list * ImportedAssembly list)
  491.  
  492. //----------------------------------------------------------------------------
  493. // Processing # commands
  494. //--------------------------------------------------------------------------
  495.  
  496. val public ProcessMetaCommandsFromInput :
  497.               ('T -> range * string -> 'T) *
  498.               ('T -> range * string -> 'T) *
  499.               ('T -> range * string -> unit) -> TcConfigBuilder -> Ast.Input -> 'T -> 'T
  500.  
  501.  
  502. val public GetScopedPragmasForInput : Ast.Input -> ScopedPragma list
  503. val public GetErrorLoggerFilteringByScopedPragmas : checkFile:bool * ScopedPragma list * ErrorLogger  -> ErrorLogger
  504.  
  505. val public ApplyNoWarnsToTcConfig : TcConfig -> Ast.Input -> TcConfig
  506. val public ApplyMetaCommandsFromInputToTcConfig : TcConfig -> Ast.Input -> TcConfig
  507. val public GetResolvedAssemblyInformation : TcConfig -> AssemblyResolution list
  508.  
  509. //----------------------------------------------------------------------------
  510. // Loading the default library sets
  511. //--------------------------------------------------------------------------
  512.                
  513. val public coreFramework : string list
  514. val public extendedFramework : string list
  515. val public scriptingFramework : string list
  516. val public scriptingBaseFramework : string list
  517.  
  518.  
  519. //----------------------------------------------------------------------------
  520. // Parsing inputs
  521. //--------------------------------------------------------------------------
  522. val internal ParseOneInputFile : TcConfig * Lexhelp.LexResourceManager * string list * string * isLastCompiland: bool * ErrorLogger -> Input option
  523.  
  524. //----------------------------------------------------------------------------
  525. // Type checking and querying the type checking state
  526. //--------------------------------------------------------------------------
  527.  
  528. val public GetInitialTypecheckerEnv : string option -> range -> TcConfig -> TcImports -> TcGlobals -> tcEnv
  529.                
  530. [<Sealed>]
  531. type TcState =
  532.     member NiceNameGenerator : Ast.NiceNameGenerator
  533.     member Ccu : CcuThunk
  534.     member TcEnvFromSignatures : tcEnv
  535.     member NextStateAfterIncrementalFragment : tcEnv -> TcState
  536.     member TcEnvFromImpls : tcEnv
  537.  
  538. val public TypecheckInitialState :
  539.     range * string * TcConfig * TcGlobals * Ast.NiceNameGenerator * tcEnv -> TcState
  540.  
  541. val public TypecheckOneInputEventually :
  542.     (unit -> bool) -> TcConfig -> TcImports -> TcGlobals
  543.       -> Ast.LongIdent option -> TcState -> Ast.Input  
  544.            -> Eventually<(tcEnv * TopAttribs * Tast.TypedImplFile list) * TcState>
  545.  
  546. val public TypecheckMultipleInputsFinish :
  547.     (tcEnv * TopAttribs * 'T list) list * TcState
  548.         -> (tcEnv * TopAttribs * 'T list) * TcState
  549.    
  550. val public TypecheckMultipleInputs :
  551.     (unit -> bool) * TcConfig * TcImports * TcGlobals * Ast.LongIdent option * TcState * Ast.Input list
  552.         -> (tcEnv * TopAttribs * Tast.TypedImplFile list) * TcState
  553.  
  554. val public TypecheckClosedInputSetFinish :
  555.     TypedImplFile list * TcState
  556.         -> TcState * TypedAssembly
  557.  
  558. val public TypecheckClosedInputSet :
  559.     (unit -> bool) * TcConfig * TcImports * TcGlobals * Ast.LongIdent option * TcState * Ast.Input  list
  560.         -> TcState * TopAttribs * Tast.TypedAssembly * tcEnv
  561.  
  562. val public TypecheckSingleInputAndFinishEventually :
  563.     (unit -> bool) * TcConfig * TcImports * TcGlobals * Ast.LongIdent option * TcState * Ast.Input
  564.         -> Eventually<(tcEnv * TopAttribs * Tast.TypedImplFile list) * TcState>
  565.  
  566. val public ParseCompilerOptions : (string -> unit) -> CompilerOptionBlock list -> string list -> unit
  567. val public ReportWarning : int -> int list -> int list -> PhasedError -> bool
  568. val public ReportWarningAsError : int -> int list -> int list -> int list -> int list -> bool -> PhasedError -> bool
  569.  
  570. val public highestInstalledNetFrameworkVersionMajorMinor : unit -> int * string
  571.  
  572. //----------------------------------------------------------------------------
  573. // #load closure
  574. //--------------------------------------------------------------------------
  575. (*
  576.     fsc.exe -- COMPILED\!INTERACTIVE
  577.     fsi.exe -- !COMPILED\INTERACTIVE
  578.     Language service
  579.         .fs -- COMPILED\!INTERACTIVE
  580.         .fsx -- !COMPILED\INTERACTIVE    
  581. *)
  582. type InteractiveOrCompile =
  583.     // Always define INTERACTIVE
  584.     | DefineInteractive
  585.     // Always define COMPILED
  586.     | DefineCompile
  587.     // Choose based on the extension of the file
  588.     | ChooseByFileExtension
  589.  
  590. type internal LoadClosure =
  591.     { /// The source files along with the ranges of the #load positions in each file.
  592.         SourceFiles: (string * range list) list
  593.         /// The resolved references along with the ranges of the #r positions in each file.
  594.         References: (string * AssemblyResolution list) list
  595.         /// The list of all sources in the closure with inputs when available
  596.         Inputs: (string * Input option) list
  597.         /// The #nowarns
  598.         NoWarns: (string * range list) list
  599.         /// *Parse* errors seen while parsing root of closure
  600.         RootErrors : PhasedError list
  601.         /// *Parse* warnings seen while parsing root of closure
  602.         RootWarnings : PhasedError list }
  603.     static member FindFromSource : filename : string * source : string * editing : bool * interactiveOrCompile:InteractiveOrCompile * useDefaultScriptingReferences : bool * lexResourceManager : Lexhelp.LexResourceManager -> LoadClosure
  604.     static member FindFromFiles : tcConfig:TcConfig * (string * range) list * editing : bool * interactiveOrCompile:InteractiveOrCompile * useDefaultScriptingReferences : bool * lexResourceManager : Lexhelp.LexResourceManager -> LoadClosure
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement