Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node2",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/src/fsharp/Fable.FCS/out/Fable.FCS/project.js",
"cwd": "${workspaceRoot}"
},
{
"type": "node2",
"request": "attach",
"name": "Attach to Process",
"port": 5858
}
]
}
27 changes: 27 additions & 0 deletions Export.FCS.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Service", "src\fsharp\FSharp.Compiler.Service\FSharp.Compiler.Service.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Export.FCS", "src\fsharp\Export.FCS\Export.FCS.fsproj", "{C89727FE-5D40-4DE2-B751-753D75C86E4C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU
{C89727FE-5D40-4DE2-B751-753D75C86E4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C89727FE-5D40-4DE2-B751-753D75C86E4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C89727FE-5D40-4DE2-B751-753D75C86E4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C89727FE-5D40-4DE2-B751-753D75C86E4C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
14 changes: 12 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#### 9.0.1
* [Adds FormatValue to FsiEvaluationSession, using the fsi object values for formatting](https://github.com/fsharp/FSharp.Compiler.Service/pull/686)

#### 9.0.0
* Update names of union fields in AST API
* Fix load closure for ParseAndCheckInteraction
* [Fix #631 compiler dependency on MSBuild](https://github.com/fsharp/FSharp.Compiler.Service/pull/657)
* Fixed netcore codegen on Linux
* Explicit error when cracker exe is missing

#### 8.0.0
* Integrate fsharp\fsharp and Microsoft\visualfsharp to c494a9cab525dbd89585f7b733ea5310471a8001
* Then integrate to 2002675f8aba5b3576a924a2e1e47b18e4e9a83d
* Add module values to navigable items https://github.com/fsharp/FSharp.Compiler.Service/pull/650
* [Add module values to navigable items](https://github.com/fsharp/FSharp.Compiler.Service/pull/650)
* Optionally remove dependency on MSBuild reference resolution https://github.com/fsharp/FSharp.Compiler.Service/pull/649
* Compiler api harmonise https://github.com/fsharp/FSharp.Compiler.Service/pull/639
* [Compiler api harmonise](https://github.com/fsharp/FSharp.Compiler.Service/pull/639)
* Various bits of work on .NET Core version (buildable from source but not in nuget package)

#### 7.0.0
Expand Down
13 changes: 13 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,14 +272,27 @@ Target "CodeGen.NetCore" (fun _ ->
let fsLex fsl out = runInDir (toolDir + "fslex.exe") "%s --unicode %s -o %s" fsl lexArgs out
let fsYacc fsy out m o = runInDir (toolDir + "fsyacc.exe") "%s %s %s %s %s -o %s" fsy lexArgs yaccArgs m o out

#if FABLE_COMPILER
// until a more recent version of fssrgen is released, building from source
runInDir "dotnet" "run -c Release -p /Projects/FsSrGen/src/dotnet-fssrgen ../FSComp.txt ./FSComp.fs"
runInDir "dotnet" "run -c Release -p /Projects/FsSrGen/src/dotnet-fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs"
#else
runInDir "dotnet" "fssrgen ../FSComp.txt ./FSComp.fs ./FSComp.resx"
runInDir "dotnet" "fssrgen ../fsi/FSIstrings.txt ./FSIstrings.fs ./FSIstrings.resx"
#endif
fsLex "../lex.fsl" "lex.fs"
fsLex "../pplex.fsl" "pplex.fs"
fsLex "../../absil/illex.fsl" "illex.fs"
fsYacc "../../absil/ilpars.fsy" "ilpars.fs" module1 open1
fsYacc "../pars.fsy" "pars.fs" module2 open2
fsYacc "../pppars.fsy" "pppars.fs" module3 open3

#if FABLE_COMPILER
// comments the #line directive as it is not supported by Fable
["lex.fs"; "pplex.fs"; "illex.fs"; "ilpars.fs"; "pars.fs"; "pppars.fs"]
|> Seq.map (fun fileName -> IO.Path.Combine (workDir, fileName))
|> RegexReplaceInFilesWithEncoding @"# (?=\d)" "//# " Text.Encoding.UTF8
#endif
)

Target "Build.NetCore" (fun _ ->
Expand Down
15 changes: 8 additions & 7 deletions docs/content/compiler.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ First, we need to reference the libraries that contain F# interactive service:
*)

#r "FSharp.Compiler.Service.dll"
open Microsoft.FSharp.Compiler.SimpleSourceCodeServices
open System.IO
open Microsoft.FSharp.Compiler.SourceCodeServices

let scs = SimpleSourceCodeServices()
// Create an interactive checker instance
let checker = FSharpChecker.Create()

(**
Now write content to a temporary file:

*)
let fn = Path.GetTempFileName()
let fn2 = Path.ChangeExtension(fn, ".fs")
let fn2 = Path.ChangeExtension(fn, ".fsx")
let fn3 = Path.ChangeExtension(fn, ".dll")

File.WriteAllText(fn2, """
Expand All @@ -54,7 +55,7 @@ let x = 3 + 4
Now invoke the compiler:
*)

let errors1, exitCode1 = scs.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |])
let errors1, exitCode1 = checker.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |])

(**

Expand All @@ -67,7 +68,7 @@ module M
let x = 1.0 + "" // a type error
""")

let errors1b, exitCode1b = scs.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |])
let errors1b, exitCode1b = checker.Compile([| "fsc.exe"; "-o"; fn3; "-a"; fn2 |])

(**

Expand All @@ -83,11 +84,11 @@ You still have to pass the "-o" option to name the output file, but the output f
The 'None' option indicates that the initiatlization code for the assembly is not executed.
*)
let errors2, exitCode2, dynAssembly2 =
scs.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], execute=None)
checker.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], execute=None)

(*
Passing 'Some' for the 'execute' parameter executes the initiatlization code for the assembly.
*)
let errors3, exitCode3, dynAssembly3 =
scs.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], Some(stdout,stderr))
checker.CompileToDynamicAssembly([| "-o"; fn3; "-a"; fn2 |], Some(stdout,stderr))

2 changes: 1 addition & 1 deletion docs/content/tokenizer.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ file name of the source code. The defined symbols are required because the
tokenizer handles `#if` directives. The file name is required only to specify
locations of the source code (and it does not have to exist):
*)
let sourceTok = FSharpSourceTokenizer([], "C:\\test.fsx")
let sourceTok = FSharpSourceTokenizer([], Some "C:\\test.fsx")
(**
Using the `sourceTok` object, we can now (repeatedly) tokenize lines of
F# source code.
Expand Down
4 changes: 2 additions & 2 deletions docs/content/typedtree.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ let (fooSymbol, fooArgs, fooExpression) =
| _ -> failwith "unexpected"


(** Here 'fooSymbol' is a symbold associated with the declaration of 'foo',
(** Here 'fooSymbol' is a symbol associated with the declaration of 'foo',
'fooArgs' represents the formal arguments to the 'foo' function, and 'fooExpression'
is an expression for the implementation of the 'foo' function.

Expand Down Expand Up @@ -241,7 +241,7 @@ let rec visitExpr f (e:FSharpExpr) =
visitExpr f baseCallExpr
List.iter (visitObjMember f) overrides
List.iter (snd >> List.iter (visitObjMember f)) interfaceImplementations
| BasicPatterns.TraitCall(sourceTypes, traitName, typeArgs, typeInstantiation, argExprs) ->
| BasicPatterns.TraitCall(sourceTypes, traitName, typeArgs, typeInstantiation, argTypes, argExprs) ->
visitExprs f argExprs
| BasicPatterns.ValueSet(valToSet, valueExpr) ->
visitExpr f valueExpr
Expand Down
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"projects": [ "src/fsharp", "tests" ]
"projects": [ "src/fsharp", "tests" ],
"sdk": {
"version": "1.0.0-preview2-003131"
}
}
2 changes: 2 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
frameworks: net46, netstandard16, netcoreapp10

source https://www.myget.org/F/dotnet-core/api/v3/index.json
source https://www.nuget.org/api/v2/

Expand Down
8 changes: 4 additions & 4 deletions samples/FscExe/FscMain.fs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ open System.IO
open System.Reflection
open System.Runtime.CompilerServices
open Microsoft.FSharp.Compiler
open Microsoft.FSharp.Compiler.SourceCodeServices
open Microsoft.FSharp.Compiler.AbstractIL.IL // runningOnMono
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
open Microsoft.FSharp.Compiler.ErrorLogger
open Microsoft.FSharp.Compiler.SimpleSourceCodeServices
open Microsoft.FSharp.Compiler.Range

#if FX_RESHAPED_REFLECTION
Expand Down Expand Up @@ -83,7 +83,7 @@ module FSharpResidentCompiler =
let! (pwd,argv, reply: AsyncReplyChannel<_>) = inbox.Receive()
if !progress then printfn "server agent: got compilation request, argv = %A" argv
Environment.CurrentDirectory <- pwd
let errors, exitCode = SimpleSourceCodeServices().Compile (argv);
let errors, exitCode = FSharpChecker.Create().Compile (argv);
for error in errors do eprintfn "%s" (error.ToString())
if !progress then printfn "server: finished compilation request, argv = %A" argv
let output = outputCollector.GetTextAndClear()
Expand Down Expand Up @@ -286,7 +286,7 @@ module Driver =
match exitCodeOpt with
| Some exitCode -> exitCode
| None ->
let errors, exitCode = SimpleSourceCodeServices().Compile (argv)
let errors, exitCode = FSharpChecker.Create().Compile (argv)
for error in errors do eprintfn "%s" (error.ToString())
exitCode

Expand All @@ -295,7 +295,7 @@ module Driver =
0

else
let errors, exitCode = SimpleSourceCodeServices().Compile (argv)
let errors, exitCode = FSharpChecker.Create().Compile (argv)
for error in errors do eprintfn "%s" (error.ToString())
exitCode

Expand Down
Loading