Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

FsLex/FsYacc output integrated into VS #16

Merged
merged 7 commits into from

1 participant

@sergey-tihon
Collaborator

#6 is implemented

sergey-tihon added some commits
@sergey-tihon sergey-tihon FsLex/FxYacc error messages redirected to stderr stream a81f0e9
@sergey-tihon sergey-tihon Parser for FsLex/FsYacc error messages was implemented
Messages from stderr stream redirected to VS error window
0c99c7a
@sergey-tihon sergey-tihon Unit tests for error parser were added 2431721
@sergey-tihon sergey-tihon Logging refactored + new test added 23732cb
@sergey-tihon sergey-tihon Versioning of 'FsLexYacc.Runtime' is separated from 'FsLexYacc' 7763b87
@sergey-tihon sergey-tihon FsYacc verbose output added to MSBuild log 9ca6d26
@sergey-tihon sergey-tihon FsYacc documentation is updated
55d19a6
@sergey-tihon sergey-tihon merged commit c387f85 into fsprojects:master

0 of 2 checks passed

Details continuous-integration/appveyor Waiting for AppVeyor build to complete
Details continuous-integration/travis-ci The Travis CI build is in progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 16, 2014
  1. @sergey-tihon
  2. @sergey-tihon

    Parser for FsLex/FsYacc error messages was implemented

    sergey-tihon authored
    Messages from stderr stream redirected to VS error window
  3. @sergey-tihon
Commits on Jul 17, 2014
  1. @sergey-tihon
  2. @sergey-tihon
Commits on Jul 18, 2014
  1. @sergey-tihon
  2. @sergey-tihon

    FsYacc documentation is updated

    sergey-tihon authored
This page is out of date. Refresh to see the latest.
View
36 FsLexYacc.sln
@@ -44,34 +44,68 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{8E6D
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{ED8079DD-2B06-4030-9F0F-DC548F98E1C4}"
EndProject
-Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsLexYacc.Tests", "tests\FsLexYacc.Tests\FsLexYacc.Tests.fsproj", "{E789C72A-5CFD-436B-8EF1-61AA2852A89F}"
+Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsLexYacc.Build.Tasks.Tests", "tests\FsLexYacc.Build.Tasks.Tests\FsLexYacc.Build.Tasks.Tests.fsproj", "{E789C72A-5CFD-436B-8EF1-61AA2852A89F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {BD2284A5-AA4D-442D-B4FB-E43B2FE9DD2A}.Release|x86.ActiveCfg = Release|Any CPU
{DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Debug|x86.ActiveCfg = Debug|Any CPU
{DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {DDD90630-1CDA-4CB3-9A0A-6A1253478C2D}.Release|x86.ActiveCfg = Release|Any CPU
{7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Debug|x86.ActiveCfg = Debug|Any CPU
{7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {7E90D6CE-A10B-4858-A5BC-41DF7250CBCC}.Release|x86.ActiveCfg = Release|Any CPU
{A9566921-4193-4EC8-83FB-F5A0DC257678}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9566921-4193-4EC8-83FB-F5A0DC257678}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A9566921-4193-4EC8-83FB-F5A0DC257678}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {A9566921-4193-4EC8-83FB-F5A0DC257678}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {A9566921-4193-4EC8-83FB-F5A0DC257678}.Debug|x86.ActiveCfg = Debug|Any CPU
{A9566921-4193-4EC8-83FB-F5A0DC257678}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9566921-4193-4EC8-83FB-F5A0DC257678}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A9566921-4193-4EC8-83FB-F5A0DC257678}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {A9566921-4193-4EC8-83FB-F5A0DC257678}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {A9566921-4193-4EC8-83FB-F5A0DC257678}.Release|x86.ActiveCfg = Release|Any CPU
{E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Debug|x86.ActiveCfg = Debug|Any CPU
{E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {E789C72A-5CFD-436B-8EF1-61AA2852A89F}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
6 RELEASE_NOTES.md
@@ -3,4 +3,8 @@
#### 6.0.2 - June 16 2014
* Logo was added
-* FsLexYacc.Runtime published as a separate NuGet package
+* FsLexYacc.Runtime published as a separate NuGet package
+
+#### 6.0.3 - June 18 2014
+* FsLex/FsYacc output redirected to VS Output window
+* FsYacc verbose output added to MSBuild log (and VS Output window)
View
2  RELEASE_NOTES_Runtime.md
@@ -0,0 +1,2 @@
+#### 6.0.2 - June 16 2014
+* Initial release
View
15 build.fsx
@@ -22,7 +22,7 @@ open System
// The name of the project
// (used by attributes in AssemblyInfo, name of a NuGet package and directory in 'src')
-let projects = [ "FsLex"; "FsYacc"; "FsLexYacc.Build.Tasks"; "FsLexYacc.Runtime" ]
+let projects = [ "FsLex"; "FsYacc"; "FsLexYacc.Build.Tasks"]
let project = "FsLexYacc"
// Short summary of the project
// (used as description in AssemblyInfo and as a short summary for NuGet package)
@@ -50,9 +50,16 @@ let gitName = "FsLexYacc"
// Read additional information from the release notes document
Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
let release = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES.md")
+let releaseRuntime = parseReleaseNotes (IO.File.ReadAllLines "RELEASE_NOTES_Runtime.md")
// Generate assembly info files with the right version & up-to-date information
Target "AssemblyInfo" (fun _ ->
+ CreateFSharpAssemblyInfo "src/FsLexYacc.Runtime/AssemblyInfo.fs"
+ [ Attribute.Title "FsLexYacc.Runtime"
+ Attribute.Product "FsLexYacc.Runtime"
+ Attribute.Description summary
+ Attribute.Version releaseRuntime.AssemblyVersion
+ Attribute.FileVersion releaseRuntime.AssemblyVersion ]
for project in projects do
let fileName = "src/" + project + "/AssemblyInfo.fs"
CreateFSharpAssemblyInfo fileName
@@ -106,8 +113,8 @@ Target "NuGet-FsLexYacc.Runtime" (fun _ ->
Authors = authors
Summary = summary
Description = """Runtime for FsLex/FsYacc lexer/parser generation tools"""
- Version = release.NugetVersion
- ReleaseNotes = String.Join(Environment.NewLine, release.Notes)
+ Version = releaseRuntime.NugetVersion
+ ReleaseNotes = String.Join(Environment.NewLine, releaseRuntime.Notes)
Tags = "F# fsharp programming fslex fsyacc parser runtime"
OutputPath = "bin"
AccessKey = getBuildParamOrDefault "nugetkey" ""
@@ -128,7 +135,7 @@ Target "NuGet-FsLexYacc" (fun _ ->
OutputPath = "bin"
AccessKey = getBuildParamOrDefault "nugetkey" ""
Publish = hasBuildParam "nugetkey"
- Dependencies = ["FsLexYacc.Runtime",release.NugetVersion] })
+ Dependencies = ["FsLexYacc.Runtime",releaseRuntime.NugetVersion] })
("nuget/FsLexYacc.nuspec")
)
View
8 docs/content/fsyacc.md
@@ -79,7 +79,7 @@ MSBuild support
The nuget package includes MSBuild support for `FsLex` and `FsYacc`. You must add a `FsLexYacc.targets` reference
to your project file manually like this (adjust the nuget package number if needed):
- <Import Project="..\packages\FsLexYacc.6.0.1\bin\FsLexYacc.targets" />
+ <Import Project="..\packages\FsLexYacc.6.0.3\bin\FsLexYacc.targets" />
You must also add `FsLex` andd `FsYacc` entries like this:
@@ -89,6 +89,12 @@ You must also add `FsLex` andd `FsYacc` entries like this:
<FsLex Include="..\LexAndYaccMiniProject\Lexer.fsl">
<OtherFlags>--unicode</OtherFlags>
</FsLex>
+
+If you want to see `verbose` output from `FsYacc` you need to add `-v` in `OtherFlags` section like this:
+
+ <FsYacc Include="..\LexAndYaccMiniProject\Parser.fsy">
+ <OtherFlags>--module Parser -v</OtherFlags>
+ </FsYacc>
Command line options
--------------------
View
6 src/FsLex/AssemblyInfo.fs
@@ -4,9 +4,9 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("FsLex")>]
[<assembly: AssemblyProductAttribute("FsLex")>]
[<assembly: AssemblyDescriptionAttribute("FsLex/FsYacc lexer/parser generation tools")>]
-[<assembly: AssemblyVersionAttribute("6.0.2")>]
-[<assembly: AssemblyFileVersionAttribute("6.0.2")>]
+[<assembly: AssemblyVersionAttribute("6.0.3")>]
+[<assembly: AssemblyFileVersionAttribute("6.0.3")>]
do ()
module internal AssemblyVersionInformation =
- let [<Literal>] Version = "6.0.2"
+ let [<Literal>] Version = "6.0.3"
View
4 src/FsLex/fslex.fs
@@ -78,7 +78,7 @@ let main() =
try
Parser.spec Lexer.token lexbuf
with e ->
- printf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column
+ eprintf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column
(match e with
| Failure s -> s
| _ -> e.Message);
@@ -218,7 +218,7 @@ let main() =
cfprintfn os "# 3000000 \"%s\"" output;
with e ->
- printf "FSLEX: error FSL000: %s" (match e with Failure s -> s | e -> e.ToString());
+ eprintf "FSLEX: error FSL000: %s" (match e with Failure s -> s | e -> e.ToString());
exit 1
View
6 src/FsLexYacc.Build.Tasks/AssemblyInfo.fs
@@ -4,9 +4,9 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("FsLexYacc.Build.Tasks")>]
[<assembly: AssemblyProductAttribute("FsLexYacc.Build.Tasks")>]
[<assembly: AssemblyDescriptionAttribute("FsLex/FsYacc lexer/parser generation tools")>]
-[<assembly: AssemblyVersionAttribute("6.0.2")>]
-[<assembly: AssemblyFileVersionAttribute("6.0.2")>]
+[<assembly: AssemblyVersionAttribute("6.0.3")>]
+[<assembly: AssemblyFileVersionAttribute("6.0.3")>]
do ()
module internal AssemblyVersionInformation =
- let [<Literal>] Version = "6.0.2"
+ let [<Literal>] Version = "6.0.3"
View
5 src/FsLexYacc.Build.Tasks/FsLex.Build.fs
@@ -99,3 +99,8 @@ type FsLex() =
// Expose this to internal components (for unit testing)
member internal this.InternalGenerateCommandLineCommands() =
this.GenerateCommandLineCommands()
+
+ // Log errors and warnings
+ override this.LogEventsFromTextOutput(singleLine, _) =
+ if not <| Logging.logFsLexYaccOutput singleLine this.Log
+ then base.LogEventsFromTextOutput(singleLine, MessageImportance.High)
View
8 src/FsLexYacc.Build.Tasks/FsLexYacc.Build.Tasks.fsproj
@@ -31,6 +31,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="AssemblyInfo.fs" />
+ <Compile Include="Logging.fs" />
<Compile Include="FsLex.Build.fs" />
<Compile Include="FsYacc.Build.fs" />
<Content Include="FsLexYacc.targets">
@@ -50,11 +51,16 @@
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
- <PropertyGroup Condition="'$(VisualStudioVersion)' > '11.0' And '$(FSharpTargetsPath)' == ''">
+ <PropertyGroup Condition="'$(VisualStudioVersion)' &gt; '11.0' And '$(FSharpTargetsPath)' == ''">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0' Or $(OS) != 'Windows_NT'">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <StartAction>Program</StartAction>
+ <StartProgram>C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe</StartProgram>
+ <StartArguments>..\..\tests\TestProjects.sln</StartArguments>
+ </PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
</Project>
View
1  src/FsLexYacc.Build.Tasks/FsLexYacc.targets
@@ -58,6 +58,7 @@ Copyright (C) Microsoft Corporation. All rights reserved.
<FsYacc
InputFile="%(FsYacc.Identity)"
OutputFile="$(FsYaccOutputFolder)%(FsYacc.Filename).fs"
+ VerboseFile="$(FsYaccOutputFolder)%(FsYacc.Filename).fsyacc.output"
Open="%(FsYacc.Open)"
Module="%(FsYacc.Module)"
OtherFlags="%(FsYacc.OtherFlags)"
View
21 src/FsLexYacc.Build.Tasks/FsYacc.Build.fs
@@ -15,6 +15,7 @@ type FsYacc() =
let mutable inputFile : string = null
let mutable outputFile : string = null
+ let mutable verboseFile: string = null
let mutable codePage : string = null
let mutable otherFlags : string = null
@@ -35,6 +36,10 @@ type FsYacc() =
member this.OutputFile
with get () = outputFile
and set (x) = outputFile <- x
+
+ member this.VerboseFile
+ with get () = verboseFile
+ and set (x) = verboseFile <- x
member this.OtherFlags
with get() = otherFlags
@@ -112,3 +117,19 @@ type FsYacc() =
// Expose this to internal components (for unit testing)
member internal this.InternalGenerateCommandLineCommands() =
this.GenerateCommandLineCommands()
+
+ // Log errors and warnings
+ override this.LogEventsFromTextOutput(singleLine, _) =
+ if not <| Logging.logFsLexYaccOutput singleLine this.Log
+ then base.LogEventsFromTextOutput(singleLine, MessageImportance.High)
+
+ override this.Execute () =
+ let result = base.Execute()
+ if IO.File.Exists verboseFile then
+ let message = sprintf "Log from verbose output file '%s':" verboseFile
+ this.Log.LogMessageFromText("------------------------", MessageImportance.High) |> ignore
+ this.Log.LogMessageFromText(message, MessageImportance.High) |> ignore
+ for lineOfText in IO.File.ReadAllLines verboseFile do
+ this.Log.LogMessageFromText(lineOfText, MessageImportance.High) |> ignore
+ this.DeleteTempFile(verboseFile)
+ result
View
53 src/FsLexYacc.Build.Tasks/Logging.fs
@@ -0,0 +1,53 @@
+module Microsoft.FSharp.Build.Logging
+
+open System
+open System.IO
+open System.Text.RegularExpressions
+open Microsoft.Build.Utilities
+
+// Error formats used in FsLex and FsYacc
+
+let (|FsLexYaccError|_|) =
+ // eprintf "%s(%d,%d): error: %s"
+ let fsLexYaccErrorPattern = Regex(@"^(?<ORIGIN>.*)\((?<LINE>\d+),(?<COLUMN>\d+)\)\: error\: (?<MESSAGE>.*)$", RegexOptions.Compiled)
+ (fun s ->
+ let x = fsLexYaccErrorPattern.Match(s)
+ match x.Success with
+ | true ->
+ let origin = x.Groups.["ORIGIN"].Value.Trim()
+ let line = x.Groups.["LINE"].Value.Trim() |> Int32.Parse
+ let column = x.Groups.["COLUMN"].Value.Trim() |> Int32.Parse
+ let message = x.Groups.["MESSAGE"].Value.Trim()
+ Some(origin, line, column, message)
+ | _ -> None)
+
+let (|FsLexCrash|_|) =
+ // eprintf "FSLEX: error FSL000: %s"
+ let fsLexCrashPattern = Regex(@"^FSLEX: error FSL000: (?<MESSAGE>.*)$", RegexOptions.Compiled)
+ (fun s ->
+ let x = fsLexCrashPattern.Match(s)
+ match x.Success with
+ | true -> Some(x.Groups.["MESSAGE"].Value.Trim())
+ | _ -> None)
+
+let (|FsYaccCrash|_|) =
+ // eprintf "FSYACC: error FSY000: %s"
+ let fsYaccCrashPattern = Regex(@"^FSYACC: error FSY000: (?<MESSAGE>.*)$", RegexOptions.Compiled)
+ (fun s ->
+ let x = fsYaccCrashPattern.Match(s)
+ match x.Success with
+ | true -> Some(x.Groups.["MESSAGE"].Value.Trim())
+ | _ -> None)
+
+let logFsLexYaccOutput s (log:TaskLoggingHelper) =
+ match s with
+ | FsLexYaccError (origin, line, column, message) ->
+ let filePath =
+ try FileInfo(origin).FullName
+ with |_-> origin
+ log.LogError(null, null, null, filePath, line, column, line, column, message, [||]); true
+ | FsLexCrash message ->
+ log.LogError("FSLEX", "FSL000", null, null, 0, 0, 0, 0, message, [||]); true
+ | FsYaccCrash message ->
+ log.LogError("FSYACC", "FSY000", null, null, 0, 0, 0, 0, message, [||]); true
+ | _ -> false
View
6 src/FsYacc/AssemblyInfo.fs
@@ -4,9 +4,9 @@ open System.Reflection
[<assembly: AssemblyTitleAttribute("FsYacc")>]
[<assembly: AssemblyProductAttribute("FsYacc")>]
[<assembly: AssemblyDescriptionAttribute("FsLex/FsYacc lexer/parser generation tools")>]
-[<assembly: AssemblyVersionAttribute("6.0.2")>]
-[<assembly: AssemblyFileVersionAttribute("6.0.2")>]
+[<assembly: AssemblyVersionAttribute("6.0.3")>]
+[<assembly: AssemblyFileVersionAttribute("6.0.3")>]
do ()
module internal AssemblyVersionInformation =
- let [<Literal>] Version = "6.0.2"
+ let [<Literal>] Version = "6.0.3"
View
4 src/FsYacc/fsyacc.fs
@@ -106,7 +106,7 @@ let main() =
Parser.spec Lexer.token lexbuf
with e ->
- printf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column e.Message;
+ eprintf "%s(%d,%d): error: %s" filename lexbuf.StartPos.Line lexbuf.StartPos.Column e.Message;
exit 1 in
let has_extension (s:string) =
@@ -526,6 +526,6 @@ let main() =
let _ =
try main()
with e ->
- printf "FSYACC: error FSY000: %s" (match e with Failure s -> s | e -> e.Message);
+ eprintf "FSYACC: error FSY000: %s" (match e with Failure s -> s | e -> e.Message);
exit 1
View
22 tests/FsLexYacc.Tests/FsLexYacc.Tests.fsproj → ....Tests/FsLexYacc.Build.Tasks.Tests.fsproj
@@ -11,7 +11,7 @@
<AssemblyName>FsLexYacc.Tests</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.3.0.0</TargetFSharpCoreVersion>
- <Name>FsLexYacc.Tests</Name>
+ <Name>FsLexYacc.Build.Tasks.Tests</Name>
<TargetFrameworkProfile />
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
@@ -46,7 +46,7 @@
<PropertyGroup Condition="Exists('$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets')">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
- <PropertyGroup Condition="'$(VisualStudioVersion)' > '11.0' And '$(FSharpTargetsPath)' == ''">
+ <PropertyGroup Condition="'$(VisualStudioVersion)' &gt; '11.0' And '$(FSharpTargetsPath)' == ''">
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0' Or $(OS) != 'Windows_NT'">
@@ -57,6 +57,7 @@
<ItemGroup>
<Compile Include="Tests.fs" />
<None Include="packages.config" />
+ <None Include="app.config" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
@@ -72,24 +73,9 @@
<Reference Include="System.Numerics" />
</ItemGroup>
<ItemGroup>
- <ProjectReference Include="..\..\src\FsLex\FsLex.fsproj">
- <Name>FsLex</Name>
- <Project>{3b566646-652d-41ed-95a9-c0da626150c6}</Project>
- <Private>True</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\src\FsYacc\FsYacc.fsproj">
- <Name>FsYacc</Name>
- <Project>{3b566646-652d-41ed-95a9-c0da626150c7}</Project>
- <Private>True</Private>
- </ProjectReference>
- <ProjectReference Include="..\..\src\FsLexYacc.Runtime\FsLexYacc.Runtime.fsproj">
- <Name>FsLexYacc.Runtime</Name>
- <Project>{3b566646-652d-41ed-95a9-c0da626150c8}</Project>
- <Private>True</Private>
- </ProjectReference>
<ProjectReference Include="..\..\src\FsLexYacc.Build.Tasks\FsLexYacc.Build.Tasks.fsproj">
<Name>FsLexYacc.Build.Tasks</Name>
- <Project>{3b566646-652d-41ed-95a9-c0da626150c9}</Project>
+ <Project>{a9566921-4193-4ec8-83fb-f5a0dc257678}</Project>
<Private>True</Private>
</ProjectReference>
</ItemGroup>
View
33 tests/FsLexYacc.Build.Tasks.Tests/Tests.fs
@@ -0,0 +1,33 @@
+module FsLexYacc.Tests
+
+open NUnit.Framework
+open Microsoft.FSharp.Build.Logging
+
+
+let [<Test>]``FsLex app crash error`` () =
+ match "FSLEX: error FSL000: Something gone wrong" with
+ | FsLexCrash "Something gone wrong" -> ignore()
+ | _ -> failwith "Expected FsLexCrash"
+
+
+let [<Test>]``FsYacc app crash error`` () =
+ match "FSYACC: error FSY000: Something gone wrong" with
+ | FsYaccCrash "Something gone wrong" -> ignore()
+ | _ -> failwith "Expected FsYaccCrash"
+
+
+let [<Test>]``Unexpected character`` () =
+ match "Lexer.fsl(14,22): error: Unexpected character '''" with
+ | FsLexYaccError ("Lexer.fsl", 14, 22, "Unexpected character '''") -> ignore()
+ | _ -> failwith "Expected: Unexpected character '''"
+
+
+let [<Test>]``unterminated string in code`` () =
+ match "Lexer.fsl(35,0): error: unterminated string in code" with
+ | FsLexYaccError ("Lexer.fsl", 35, 0, "unterminated string in code") -> ignore()
+ | _ -> failwith "Expected: unterminated string in code"
+
+let [<Test>]``parse error`` () =
+ match "Lexer.fsl(37,15): error: parse error" with
+ | FsLexYaccError ("Lexer.fsl", 37, 15, "parse error") -> ignore()
+ | _ -> failwith "Expected: parse error"
View
11 tests/FsLexYacc.Build.Tasks.Tests/app.config
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
View
0  tests/FsLexYacc.Tests/packages.config → ...LexYacc.Build.Tasks.Tests/packages.config
File renamed without changes
View
9 tests/FsLexYacc.Tests/Tests.fs
@@ -1,9 +0,0 @@
-module FsLexYacc.Tests
-
-open NUnit.Framework
-
-[<Test>]
-let ``hello returns 42`` () =
- let result = 42
- printfn "%i" result
- Assert.AreEqual(42,result)
View
6 tests/LexAndYaccMiniProject/LexAndYaccMiniProject.fsproj
@@ -66,11 +66,11 @@
<FSharpTargetsPath>$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' > '11.0' And '$(FSharpTargetsPath)' == ''">
- <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
+ <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<PropertyGroup Condition="'$(VisualStudioVersion)' == '11.0' Or $(OS) != 'Windows_NT'">
- <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.0\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
+ <FSharpTargetsPath>$(MSBuildExtensionsPath32)\..\Microsoft SDKs\F#\3.1\Framework\v4.0\Microsoft.FSharp.Targets</FSharpTargetsPath>
</PropertyGroup>
<Import Project="$(FSharpTargetsPath)" />
- <Import Project="..\..\bin\FsLexYacc.targets" />
+ <Import Project="..\..\bin\Debug\FsLexYacc.targets" />
</Project>
View
14 tests/TestProjects.sln
@@ -1,12 +1,10 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.30110.0
+VisualStudioVersion = 12.0.30501.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "LexAndYaccMiniProject", "LexAndYaccMiniProject\LexAndYaccMiniProject.fsproj", "{3B566646-652D-41ED-95A9-C0DA626150C8}"
EndProject
-Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TestProjectUsingNugetPackage", "TestProjectUsingNugetPackage\TestProjectUsingNugetPackage.fsproj", "{1C6DF01C-C1F1-4A6B-9E74-24A55479939B}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -27,16 +25,6 @@ Global
{3B566646-652D-41ED-95A9-C0DA626150C8}.Release|Mixed Platforms.Build.0 = Release|x86
{3B566646-652D-41ED-95A9-C0DA626150C8}.Release|x86.ActiveCfg = Release|x86
{3B566646-652D-41ED-95A9-C0DA626150C8}.Release|x86.Build.0 = Release|x86
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Debug|x86.ActiveCfg = Debug|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Release|Any CPU.Build.0 = Release|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
- {1C6DF01C-C1F1-4A6B-9E74-24A55479939B}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Something went wrong with that request. Please try again.