Skip to content

Implements extended if grammar #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
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
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,18 @@ src/fsharp/FSharp.Compiler/ilpars.fsi
src/fsharp/FSharp.Compiler/lex.fs
src/fsharp/FSharp.Compiler/pars.fs
src/fsharp/FSharp.Compiler/pars.fsi
src/fsharp/FSharp.Compiler/pplex.fs
src/fsharp/FSharp.Compiler/pppars.fs
src/fsharp/FSharp.Compiler/pppars.fsi
src/fsharp/FSharp.Compiler-proto/illex.fs
src/fsharp/FSharp.Compiler-proto/ilpars.fs
src/fsharp/FSharp.Compiler-proto/ilpars.fsi
src/fsharp/FSharp.Compiler-proto/lex.fs
src/fsharp/FSharp.Compiler-proto/pars.fs
src/fsharp/FSharp.Compiler-proto/pars.fsi
src/fsharp/FSharp.Compiler-proto/pplex.fs
src/fsharp/FSharp.Compiler-proto/pppars.fs
src/fsharp/FSharp.Compiler-proto/pppars.fsi
*~
tests/projects/Sample_VS2012_FSharp_ConsoleApp_net45_with_resource/Sample_VS2012_FSharp_ConsoleApp_net45/Sample_VS2012_FSharp_ConsoleApp_net45.sln
tests/projects/Sample_VS2012_FSharp_ConsoleApp_net45_with_resource/Sample_VS2012_FSharp_ConsoleApp_net45/Sample_VS2012_FSharp_ConsoleApp_net45.userprefs
Expand All @@ -68,6 +74,9 @@ src/fsharp/FSharp.LanguageService.Compiler/illex.*
src/fsharp/FSharp.LanguageService.Compiler/ilpars.*
src/fsharp/FSharp.LanguageService.Compiler/lex.*
src/fsharp/FSharp.LanguageService.Compiler/pars.*
src/fsharp/FSharp.LanguageService.Compiler/pplex.fs
src/fsharp/FSharp.LanguageService.Compiler/pppars.fs
src/fsharp/FSharp.LanguageService.Compiler/pppars.fsi
tests/fsharp/typecheck/sigs/*.dll
tests/fsharp/typecheck/sigs/*.exe
vsintegration/src/unittests/Unittests.fsi
Expand Down
3 changes: 3 additions & 0 deletions src/assemblyinfo/assemblyinfo.FSharp.Compiler.dll.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ open System.Reflection

// Note: internals visible to unit test DLLs in Retail (and all) builds.
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Test")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("FSharp.Compiler.Unittests")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Salsa")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Unittests")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("SystematicUnitTests")>]
Expand All @@ -45,6 +46,7 @@ open System.Reflection
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("SystematicUnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("FSharp.Compiler.Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
#endif

#if STRONG_NAME_FSHARP_COMPILER_WITH_TEST_KEY
Expand All @@ -62,6 +64,7 @@ open System.Reflection
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010077d32e043d184cf8cebf177201ec6fad091581a3a639a0534f1c4ebb3ab847a6b6636990224a04cf4bd1aec51ecec44cf0c8922eb5bb2ee65ec3fb9baa87e141042c96ce414f98af33508c7e24dab5b068aa802f6693881537ee0efcb5d3f1c9aaf8215ac42e92ba9a5a02574d6890d07464cb2f338b043b1c4ffe98efe069ee")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("SystematicUnitTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010077d32e043d184cf8cebf177201ec6fad091581a3a639a0534f1c4ebb3ab847a6b6636990224a04cf4bd1aec51ecec44cf0c8922eb5bb2ee65ec3fb9baa87e141042c96ce414f98af33508c7e24dab5b068aa802f6693881537ee0efcb5d3f1c9aaf8215ac42e92ba9a5a02574d6890d07464cb2f338b043b1c4ffe98efe069ee")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("Test, PublicKey=002400000480000094000000060200000024000052534131000400000100010077d32e043d184cf8cebf177201ec6fad091581a3a639a0534f1c4ebb3ab847a6b6636990224a04cf4bd1aec51ecec44cf0c8922eb5bb2ee65ec3fb9baa87e141042c96ce414f98af33508c7e24dab5b068aa802f6693881537ee0efcb5d3f1c9aaf8215ac42e92ba9a5a02574d6890d07464cb2f338b043b1c4ffe98efe069ee")>]
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("FSharp.Compiler.Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010077d32e043d184cf8cebf177201ec6fad091581a3a639a0534f1c4ebb3ab847a6b6636990224a04cf4bd1aec51ecec44cf0c8922eb5bb2ee65ec3fb9baa87e141042c96ce414f98af33508c7e24dab5b068aa802f6693881537ee0efcb5d3f1c9aaf8215ac42e92ba9a5a02574d6890d07464cb2f338b043b1c4ffe98efe069ee")>]
#endif


Expand Down
1 change: 1 addition & 0 deletions src/fsharp-library-unittests-build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<!-- Core library tests: all except compact framework (no nunit there) -->
<ItemGroup Condition=" '$(TargetFramework)' != 'sl3-wp' and '$(TargetFramework)' != 'sl5'">
<ProjectFiles Include="fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj"/>
<ProjectFiles Include="fsharp/FSharp.Compiler.Unittests/FSharp.Compiler.Unittests.fsproj"/>
</ItemGroup>

<Import Project="root.traversal.targets"/>
Expand Down
6 changes: 6 additions & 0 deletions src/fsharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Data.TypeProviders",
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsiAnyCPU", "fsharp\fsiAnyCpu\FsiAnyCPU.fsproj", "{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Unittests", "fsharp\FSharp.Compiler.Unittests\FSharp.Compiler.Unittests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -75,6 +77,10 @@ Global
{CB7D20C4-6506-406D-9144-5342C3595F03}.Release|Any CPU.Build.0 = Release|Any CPU
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|Any CPU.ActiveCfg = Debug|x86
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.ActiveCfg = Release|x86
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
6 changes: 5 additions & 1 deletion src/fsharp/FSComp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ lexHashEndingNoMatchingIf,"#endif has no matching #if"
1169,lexHashIfMustHaveIdent,"#if directive should be immediately followed by an identifier"
1170,lexWrongNestedHashEndif,"Syntax error. Wrong nested #endif, unexpected tokens before it."
lexHashBangMustBeFirstInFile,"#! may only appear as the first line at the start of a file."
1171,lexExpectedSingleLineComment,"Expected single line comment or end of line"
1171,pplexExpectedSingleLineComment,"Expected single line comment or end of line"
1172,memberOperatorDefinitionWithNoArguments,"Infix operator member '%s' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ..."
1173,memberOperatorDefinitionWithNonPairArgument,"Infix operator member '%s' has %d initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ..."
1174,memberOperatorDefinitionWithCurriedArguments,"Infix operator member '%s' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ..."
Expand Down Expand Up @@ -1336,3 +1336,7 @@ descriptionUnavailable,"(description unavailable...)"
3180,abImplicitHeapAllocation,"The mutable local '%s' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed."
estApplyStaticArgumentsForMethodNotImplemented,"A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid"
3181,etErrorApplyingStaticArgumentsToMethod,"An error occured applying the static arguments to a provided method"
3182,pplexUnexpectedChar,"Unexpected character '%s' in preprocessor expression"
3183,ppparsUnexpectedToken,"Unexpected token '%s' in preprocessor expression"
3184,ppparsIncompleteExpression,"Incomplete preprocessor expression"
3185,ppparsMissingToken,"Missing token '%s' in preprocessor expression"
12 changes: 12 additions & 0 deletions src/fsharp/FSharp.Compiler-proto/FSharp.Compiler-proto.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
<Link>FSComp.txt</Link>
</FsSrGen>
<EmbeddedResource Include="..\FSStrings.resx" />
<FsLex Include="..\pplex.fsl">
<OtherFlags>--lexlib Internal.Utilities.Text.Lexing</OtherFlags>
<Link>pplex.fsl</Link>
</FsLex>
<FsYacc Include="..\pppars.fsy">
<Module>Microsoft.FSharp.Compiler.PPParser</Module>
<Open>Microsoft.FSharp.Compiler</Open>
<OtherFlags>--internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing</OtherFlags>
<Link>pppars.fsy</Link>
</FsYacc>
<FsLex Include="..\lex.fsl">
<OtherFlags>--lexlib Internal.Utilities.Text.Lexing</OtherFlags>
<Link>lex.fsl</Link>
Expand Down Expand Up @@ -250,13 +260,15 @@
<Compile Include="..\ast.fs">
<Link>ast.fs</Link>
</Compile>
<Compile Include="pppars.fs" />
<Compile Include="pars.fs" />
<Compile Include="..\lexhelp.fsi">
<Link>lexhelp.fsi</Link>
</Compile>
<Compile Include="..\lexhelp.fs">
<Link>lexhelp.fs</Link>
</Compile>
<Compile Include="pplex.fs" />
<Compile Include="lex.fs" />
<Compile Include="..\sreflect.fsi">
<Link>sreflect.fsi</Link>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<FSharpSourcesRoot>..\..</FSharpSourcesRoot>
<ProjectGuid>{a8d9641a-9170-4cf4-8fe0-6db8c134e1b5}</ProjectGuid>
</PropertyGroup>
<Import Project="$(FSharpSourcesRoot)\FSharpSource.Settings.targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<AllowCrossTargeting>true</AllowCrossTargeting>
<ReferenceVsAssemblies>true</ReferenceVsAssemblies>
<OutputType>Library</OutputType>
<AssemblyName>FSharp.Compiler.Unittests</AssemblyName>
<TargetFrameworkVersion Condition=" '$(TargetFramework)' == 'net20' ">v3.5</TargetFrameworkVersion>
<Name>SystematicUnitTests</Name>
<!-- Prevent compiler from inlining calls to FSharp.Core to improve code coverage accuracy -->
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<TargetProfile Condition=" '$(TargetFramework)' == 'portable7' or '$(TargetFramework)' == 'portable78' or '$(TargetFramework)' == 'portable259' ">netcore</TargetProfile>
<!-- workaround for msbuild narrowing the assembly search paths when building portable libs -->
<AssemblySearchPaths Condition="$(TargetFramework.Contains('portable'))">
{CandidateAssemblyFiles};
{TargetFrameworkDirectory};
{Registry:Software\Microsoft\.NETFramework,v4.5,AssemblyFoldersEx};
</AssemblySearchPaths>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition=" '$(TargetFramework)' == 'sl5' ">$(DefineConstants);SILVERLIGHT</DefineConstants>
<DefineConstants>$(DefineConstants);EXTENSIONTYPING</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>3</WarningLevel>
</PropertyGroup>
<ItemGroup>
<!-- need full name and SpecificVersion = true in order to convince msbuild to allow this reference when targeting portable47 -->
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" Condition="'$(TargetFramework)' != 'sl5' AND '$(TargetFramework)' != 'sl3-wp'">
<SpecificVersion>true</SpecificVersion>
</Reference>
<Reference Include="NUnitFramework" Condition="'$(TargetFramework)' == 'sl5' OR '$(TargetFramework)' == 'sl3-wp'" />
</ItemGroup>
<ItemGroup Condition="!$(TargetFramework.Contains('portable'))">
<Reference Include="mscorlib" />
<Reference Include="System" />
<Reference Include="System.Numerics" Condition="'$(TargetFramework)' == 'net40'" />
<Reference Include="System.Core" />
<Reference Include="System.Net" Condition="'$(TargetFramework)' == 'sl5' " />
<Reference Include="System.Observable" Condition="'$(TargetFramework)' == 'sl3-wp' " />
</ItemGroup>
<ItemGroup>
<Compile Include="NUnitFrameworkShims.fs" Condition="'$(TargetFramework)' == 'sl3-wp'" />
<Compile Include="HashIfExpression.fs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler\FSharp.Compiler.fsproj">
<Name>FSharp.Compiler</Name>
<Project>{2e4d67b4-522d-4cf7-97e4-ba940f0b18f3}</Project>
</ProjectReference>
<ProjectReference Include="..\FSharp.Core\FSharp.Core.fsproj">
<Name>FSharp.Core</Name>
<Project>{ded3bbd7-53f4-428a-8c9f-27968e768605}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(FSharpSourcesRoot)\FSharpSource.targets" />
</Project>
Loading