Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion src/Paket.Core/ProjectFile.fs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ type ProjectFile =
let c = input.[index]
if data.Length = 0 && c = ' '
then parseComparison data input (index + 1)
elif data.Length = 2 && c <> ' '
elif data.Length = 2 && c <> ' ' && c <> '\''

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What you wrote here should work fine for #1057.
If I had thought of conditions without spaces when I wrote the parser, I might have written this line as something like so:

let isCompChar c = c = '<' || c = '>' || c = '!' || c = '='
...
elif data.Length = 2 && isCompChar c

(helper function so the next elif could be simplified as well)
If you want to do that with this PR, let me know how the tests go; otherwise this looks good to me 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed you're right that is a significantly less naive approach. Pull request amended.

then None
elif c = '<' || c = '>' || c = '!' || c = '='
then parseComparison (data.Append(c)) input (index + 1)
Expand Down
2 changes: 1 addition & 1 deletion tests/Paket.Tests/ProjectFile/OutputSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let ``should detect target framework for Project2 proj file``() =

[<Test>]
let ``should detect output path for proj file``
([<Values("Project1", "Project2", "Project3")>] project)
([<Values("Project1", "Project2", "Project3", "ProjectWithConditions")>] project)
([<Values("Debug", "Release")>] configuration) =
ProjectFile.Load(sprintf "./ProjectFile/TestData/%s.fsprojtest" project).Value.GetOutputDirectory configuration
|> shouldEqual (System.IO.Path.Combine(@"bin", configuration) |> normalizePath)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)'=='Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand All @@ -31,7 +31,7 @@
<StartArguments>
</StartArguments>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)|$(Platform)'=='Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
Expand Down