Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ jobs:
run: dotnet tool restore
- name: Restore packages
run: dotnet paket restore
- name: Build and test
- name: Build and test (Release)
run: dotnet fake build -t All
- name: Build (Debug)
run: dotnet build -c Debug

build-ubuntu:

Expand All @@ -37,3 +39,5 @@ jobs:
run: dotnet paket restore
- name: Build and test
run: dotnet fake build -t RunTests
- name: Build (Debug)
run: dotnet build -c Debug
8 changes: 4 additions & 4 deletions src/AssemblyInfo.DesignTime.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("FSharp.Data.DesignTime")>]
[<assembly: AssemblyProductAttribute("FSharp.Data")>]
[<assembly: AssemblyDescriptionAttribute("Library of F# type providers and data access tools")>]
[<assembly: AssemblyVersionAttribute("4.2.2.0")>]
[<assembly: AssemblyFileVersionAttribute("4.2.2.0")>]
[<assembly: AssemblyVersionAttribute("4.2.5.0")>]
[<assembly: AssemblyFileVersionAttribute("4.2.5.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "FSharp.Data.DesignTime"
let [<Literal>] AssemblyProduct = "FSharp.Data"
let [<Literal>] AssemblyDescription = "Library of F# type providers and data access tools"
let [<Literal>] AssemblyVersion = "4.2.2.0"
let [<Literal>] AssemblyFileVersion = "4.2.2.0"
let [<Literal>] AssemblyVersion = "4.2.5.0"
let [<Literal>] AssemblyFileVersion = "4.2.5.0"
8 changes: 4 additions & 4 deletions src/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("FSharp.Data")>]
[<assembly: AssemblyProductAttribute("FSharp.Data")>]
[<assembly: AssemblyDescriptionAttribute("Library of F# type providers and data access tools")>]
[<assembly: AssemblyVersionAttribute("4.2.2.0")>]
[<assembly: AssemblyFileVersionAttribute("4.2.2.0")>]
[<assembly: AssemblyVersionAttribute("4.2.5.0")>]
[<assembly: AssemblyFileVersionAttribute("4.2.5.0")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] AssemblyTitle = "FSharp.Data"
let [<Literal>] AssemblyProduct = "FSharp.Data"
let [<Literal>] AssemblyDescription = "Library of F# type providers and data access tools"
let [<Literal>] AssemblyVersion = "4.2.2.0"
let [<Literal>] AssemblyFileVersion = "4.2.2.0"
let [<Literal>] AssemblyVersion = "4.2.5.0"
let [<Literal>] AssemblyFileVersion = "4.2.5.0"
8 changes: 4 additions & 4 deletions src/Csv/CsvRuntime.fs
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,16 @@ type CsvFile<'RowType> private (rowToStringArray:Func<'RowType,string[]>, dispos

// Track created Readers so that we can dispose of all of them
let disposeFuncs = new ResizeArray<_>()
let disposed = ref false
let mutable disposed = false
let disposer =
{ new IDisposable with
member x.Dispose() =
if not !disposed then
if not disposed then
Seq.iter (fun f -> f()) disposeFuncs
disposed := true }
disposed <- true }

let newReader() =
if !disposed then
if disposed then
raise <| ObjectDisposedException(this.GetType().Name)
let reader = readerFunc.Invoke()
disposeFuncs.Add reader.Dispose
Expand Down
2 changes: 2 additions & 0 deletions src/FSharp.Data.DesignTime/FSharp.Data.DesignTime.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\keyfile.snk</AssemblyOriginatorKeyFile>
<PublicSign>false</PublicSign>
<!-- always have tailcalls on for design time compiler add-in to allow repo to compile in DEBUG, see https://github.com/fsprojects/FSharp.Data/issues/1410 -->
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\Net\Http.fs" />
Expand Down
11 changes: 2 additions & 9 deletions src/FSharp.Data/FSharp.Data.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<PublicSign>false</PublicSign>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\keyfile.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard2.0|AnyCPU'">
<!-- always have tailcalls on for design time compiler add-in to allow repo to compile in DEBUG, see https://github.com/fsprojects/FSharp.Data/issues/1410 -->
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -46,20 +45,14 @@
<Compile Include="..\Html\HtmlActivePatterns.fs" />
<Compile Include="..\AssemblyInfo.fs" />
<Compile Include="..\Runtime.fs" />
<None Include="..\..\docs\img\logo.png" Pack="true" PackagePath="\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FSharp.Data.DesignTime\FSharp.Data.DesignTime.fsproj">
<IsFSharpDesignTimeProvider>true</IsFSharpDesignTimeProvider>
<PrivateAssets>all</PrivateAssets>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="..\..\docs\img\logo.png" Pack="true" PackagePath="\" />
<None Include="..\keyfile.snk">
<Link>keyfile.snk</Link>
</None>
<None Include="keyfile.snk" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="4.7.2" />
</ItemGroup>
Expand Down
20 changes: 11 additions & 9 deletions src/Json/JsonValue.fs
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,14 @@ type private JsonParser(jsonText:string) =
skipWhitespace()
ensure(i < s.Length)
match s.[i] with
| '"' -> JsonValue.String(parseString()) |> cont
| '-' -> parseNum() |> cont
| c when Char.IsDigit(c) -> parseNum() |> cont
| '"' -> cont (JsonValue.String(parseString()))
| '-' -> cont (parseNum())
| c when Char.IsDigit(c) -> cont (parseNum())
| '{' -> parseObject cont
| '[' -> parseArray cont
| 't' -> parseLiteral("true", JsonValue.Boolean true) |> cont
| 'f' -> parseLiteral("false", JsonValue.Boolean false) |> cont
| 'n' -> parseLiteral("null", JsonValue.Null) |> cont
| 't' -> cont (parseLiteral("true", JsonValue.Boolean true))
| 'f' -> cont (parseLiteral("false", JsonValue.Boolean false))
| 'n' -> cont (parseLiteral("null", JsonValue.Null))
| _ -> throw()

and parseString() =
Expand Down Expand Up @@ -250,7 +250,7 @@ type private JsonParser(jsonText:string) =
ensure(i < s.Length && s.[i] = ':')
i <- i + 1
skipWhitespace()
parseValue (fun v -> (key, v) |> cont)
parseValue (fun v -> cont (key, v))

and parseObject cont =
ensure(i < s.Length && s.[i] = '{')
Expand All @@ -260,7 +260,8 @@ type private JsonParser(jsonText:string) =
let parseObjectEnd() =
ensure(i < s.Length && s.[i] = '}')
i <- i + 1
pairs.ToArray() |> JsonValue.Record |> cont
let res = pairs.ToArray() |> JsonValue.Record
cont res
if i < s.Length && s.[i] = '"' then
parsePair (fun p ->
pairs.Add(p)
Expand All @@ -287,7 +288,8 @@ type private JsonParser(jsonText:string) =
let parseArrayEnd() =
ensure(i < s.Length && s.[i] = ']')
i <- i + 1
vals.ToArray() |> JsonValue.Array |> cont
let res = vals.ToArray() |> JsonValue.Array
cont res
if i < s.Length && s.[i] <> ']' then
parseValue (fun v ->
vals.Add(v)
Expand Down
6 changes: 3 additions & 3 deletions src/Net/Http.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@ module internal HttpHelpers =
checkForRepeatedHeaders (header::visitedHeaders) remainingHeaders

let setHeaders headers (req:HttpWebRequest) =
let hasContentType = ref false
let mutable hasContentType = false
checkForRepeatedHeaders [] headers
headers |> List.iter (fun (header:string, value) ->
match header.ToLowerInvariant() with
Expand All @@ -1461,7 +1461,7 @@ module internal HttpHelpers =
| "content-range" -> req.Headers.[HeaderEnum.ContentRange] <- value
| "content-type" ->
req.ContentType <- value
hasContentType := true
hasContentType <- true
| "date" -> req.Date <- DateTime.SpecifyKind(DateTime.ParseExact(value, "R", CultureInfo.InvariantCulture), DateTimeKind.Utc)
| "expect" -> req.Expect <- value
| "expires" -> req.Headers.[HeaderEnum.Expires] <- value
Expand Down Expand Up @@ -1493,7 +1493,7 @@ module internal HttpHelpers =
| "warning" -> req.Headers.[HeaderEnum.Warning] <- value
| _ -> req.Headers.[header] <- value
)
hasContentType.Value
hasContentType

let getResponse (req:HttpWebRequest) silentHttpErrors =

Expand Down
2 changes: 2 additions & 0 deletions tests/FSharp.Data.Tests/FSharp.Data.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateProgramFile>false</GenerateProgramFile>
<!-- always have tailcalls on for design time compiler add-in to allow repo to compile in DEBUG, see https://github.com/fsprojects/FSharp.Data/issues/1410 -->
<Tailcalls>true</Tailcalls>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Data/**/*.*">
Expand Down
6 changes: 3 additions & 3 deletions tests/FSharp.Data.Tests/JsonProvider.fs
Original file line number Diff line number Diff line change
Expand Up @@ -411,12 +411,12 @@ let ``Can parse wiki sample``() =
[<Test>]
let ``Can load empty json file and fails on property access``() =
let document = WikiSample.Load("Data/Empty.json")
let failed = ref false
let mutable failed = false
try
document.Age |> ignore
with
| _ -> failed := true
!failed |> should be True
| _ -> failed <- true
failed |> should be True

let newJson =
"""{
Expand Down
4 changes: 2 additions & 2 deletions tests/FSharp.Data.Tests/Program.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
open System
open System

[<EntryPoint>]
let main argv =
printfn "Dotnet Core NUnit Tests..."
0
0