-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Rebuild parser from first principles #3
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
Merged
Merged
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
2a1d78b
feat: new parser WIP
bmazzarol 80fa8b9
feat: if statement parsing
bmazzarol 3aa10b1
chore: refactor parser
bmazzarol e4a1fdc
fix: remove Context allocations
bmazzarol bfc8e78
feat: improve parser
bmazzarol 58c0b80
fix: failing tests
bmazzarol 366d875
fix: add support for standard code blocks and ws suppression
bmazzarol 6a53f58
chore: update library versions
bmazzarol 42d85f5
fix: enable all tests and ensure it all works
bmazzarol 8144e29
chore: review fixes 1
bmazzarol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,28 +1,24 @@ | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- | ||
| <!-- | ||
| This file contains all the shared properties for | ||
| the benchmark projects that are in this solution | ||
| --> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <SonarQubeExclude>true</SonarQubeExclude> | ||
| <ProjectName>$(AssemblyName.Replace('.Benchmarks', ''))</ProjectName> | ||
| <OutputType>Exe</OutputType> | ||
| <TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="BenchmarkDotNet"/> | ||
| <PackageReference Include="BenchmarkDotNet.Diagnostics.dotTrace"/> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="$(MSBuildProjectDirectory)\..\$(ProjectName)\$(ProjectName).csproj"/> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"/> | ||
| </ItemGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <SonarQubeExclude>true</SonarQubeExclude> | ||
| <ProjectName>$(AssemblyName.Replace('.Benchmarks', ''))</ProjectName> | ||
| <OutputType>Exe</OutputType> | ||
| <TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="BenchmarkDotNet" /> | ||
| <PackageReference Include="BenchmarkDotNet.Diagnostics.dotTrace" /> | ||
| <PackageReference Include=" Microsoft.CodeAnalysis.CSharp" VersionOverride="4.14.0" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="$(MSBuildProjectDirectory)\..\$(ProjectName)\$(ProjectName).csproj" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,51 +1,49 @@ | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- | ||
| <!-- | ||
| This file contains all the shared properties for | ||
| the docs projects that are in this solution | ||
| --> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| </PropertyGroup> | ||
| <Target Name="BuildDocs" AfterTargets="AfterBuild" BeforeTargets="PostBuildEvent"> | ||
| <!-- Prevent parallel execution --> | ||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <BuildDocInParallel>false</BuildDocInParallel> | ||
| </PropertyGroup> | ||
|
|
||
| <Target Name="BuildDocs" AfterTargets="AfterBuild" BeforeTargets="PostBuildEvent"> | ||
| <!-- Prevent parallel execution --> | ||
| <PropertyGroup> | ||
| <BuildDocInParallel>false</BuildDocInParallel> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Check if docfx.json exists --> | ||
| <PropertyGroup> | ||
| <DocFxConfigExists Condition="Exists('docfx.json')">true</DocFxConfigExists> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- Only proceed if docfx.json exists --> | ||
| <Message Text="docfx.json not found. Skipping documentation generation." | ||
| Condition="'$(DocFxConfigExists)' != 'true'"/> | ||
|
|
||
| <CallTarget Targets="ExecuteBuildDocs" | ||
| Condition="'$(DocFxConfigExists)' == 'true'"/> | ||
| </Target> | ||
|
|
||
| <Target Name="ExecuteBuildDocs"> | ||
| <!-- Restore tools with error handling --> | ||
| <Exec Command="dotnet tool restore" | ||
| ContinueOnError="false" | ||
| StandardOutputImportance="low" | ||
| StandardErrorImportance="high"/> | ||
|
|
||
| <!-- Clean output directories --> | ||
| <RemoveDir Directories="_site;api"/> | ||
|
|
||
| <!-- Generate and build documentation --> | ||
| <Exec Command="dotnet docfx metadata docfx.json" | ||
| ContinueOnError="false" | ||
| StandardOutputImportance="normal" | ||
| StandardErrorImportance="high"/> | ||
|
|
||
| <Exec Command="dotnet docfx build docfx.json --warningsAsErrors" | ||
| ContinueOnError="false" | ||
| StandardOutputImportance="normal" | ||
| StandardErrorImportance="high"/> | ||
| </Target> | ||
| <!-- Check if docfx.json exists --> | ||
| <PropertyGroup> | ||
| <DocFxConfigExists Condition="Exists('docfx.json')">true</DocFxConfigExists> | ||
| </PropertyGroup> | ||
| <!-- Only proceed if docfx.json exists --> | ||
| <Message | ||
| Text="docfx.json not found. Skipping documentation generation." | ||
| Condition="'$(DocFxConfigExists)' != 'true'" | ||
| /> | ||
| <CallTarget Targets="ExecuteBuildDocs" Condition="'$(DocFxConfigExists)' == 'true'" /> | ||
| </Target> | ||
| <Target Name="ExecuteBuildDocs"> | ||
| <!-- Restore tools with error handling --> | ||
| <Exec | ||
| Command="dotnet tool restore" | ||
| ContinueOnError="false" | ||
| StandardOutputImportance="low" | ||
| StandardErrorImportance="high" | ||
| /> | ||
| <!-- Clean output directories --> | ||
| <RemoveDir Directories="_site;api" /> | ||
| <!-- Generate and build documentation --> | ||
| <Exec | ||
| Command="dotnet docfx metadata docfx.json" | ||
| ContinueOnError="false" | ||
| StandardOutputImportance="normal" | ||
| StandardErrorImportance="high" | ||
| /> | ||
| <Exec | ||
| Command="dotnet docfx build docfx.json --warningsAsErrors" | ||
| ContinueOnError="false" | ||
| StandardOutputImportance="normal" | ||
| StandardErrorImportance="high" | ||
| /> | ||
| </Target> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,34 @@ | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- | ||
| <!-- | ||
| This file contains all the shared properties for | ||
| the projects that are released from this solution | ||
| --> | ||
|
|
||
| <PropertyGroup> | ||
| <Authors>Ben Mazzarol</Authors> | ||
| <PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
| <PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
| <Copyright>Copyright (c) Ben Mazzarol. All rights reserved.</Copyright> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <IncludeSymbols>true</IncludeSymbols> | ||
| <SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
| <EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
| <IsPackable>True</IsPackable> | ||
| <DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile> | ||
| <PackageReadmeFile>README.md</PackageReadmeFile> | ||
| <LangVersion>latest</LangVersion> | ||
| <OutputType>library</OutputType> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="README.md" Pack="true" PackagePath="\" /> | ||
| <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Content Include="build\**" Pack="true" PackagePath="build"/> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | ||
| <_Parameter1>$(AssemblyName).Tests</_Parameter1> | ||
| </AssemblyAttribute> | ||
| </ItemGroup> | ||
|
|
||
| </Project> | ||
| <PropertyGroup> | ||
| <Authors>Ben Mazzarol</Authors> | ||
| <PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
| <PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
| <Copyright>Copyright (c) Ben Mazzarol. All rights reserved.</Copyright> | ||
| </PropertyGroup> | ||
| <PropertyGroup> | ||
| <IncludeSymbols>true</IncludeSymbols> | ||
| <SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
| <EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
| <IsPackable>True</IsPackable> | ||
| <DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile> | ||
| <PackageReadmeFile>README.md</PackageReadmeFile> | ||
| <LangVersion>latest</LangVersion> | ||
| <OutputType>library</OutputType> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <None Include="README.md" Pack="true" PackagePath="\" /> | ||
| <PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Content Include="build\**" Pack="true" PackagePath="build" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | ||
| <_Parameter1>$(AssemblyName).Tests</_Parameter1> | ||
| </AssemblyAttribute> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,40 +1,36 @@ | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <!-- | ||
| <!-- | ||
| This file contains all the shared properties for | ||
| the test projects that are in this solution | ||
| --> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <SonarQubeExclude>true</SonarQubeExclude> | ||
| <ProjectName>$(AssemblyName.Replace('.Tests', ''))</ProjectName> | ||
| <OutputType>Exe</OutputType> | ||
| <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> | ||
| <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner> | ||
| </PropertyGroup> | ||
|
|
||
| <Import Project="$(MSBuildProjectDirectory)\..\$(ProjectName)\build\$(ProjectName).props" | ||
| Condition="Exists('$(MSBuildProjectDirectory)\..\$(ProjectName)\build\$(ProjectName).props')"/> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk"/> | ||
| <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage"/> | ||
| <PackageReference Include="xunit.v3"/> | ||
| <PackageReference Include="xunit.runner.visualstudio"> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="$(MSBuildProjectDirectory)\..\$(ProjectName)\$(ProjectName).csproj"/> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute"/> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <Using Include="Xunit" /> | ||
| </ItemGroup> | ||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <SonarQubeExclude>true</SonarQubeExclude> | ||
| <ProjectName>$(AssemblyName.Replace('.Tests', ''))</ProjectName> | ||
| <OutputType>Exe</OutputType> | ||
| <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> | ||
| <UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner> | ||
| </PropertyGroup> | ||
| <Import | ||
| Project="$(MSBuildProjectDirectory)\..\$(ProjectName)\build\$(ProjectName).props" | ||
| Condition="Exists('$(MSBuildProjectDirectory)\..\$(ProjectName)\build\$(ProjectName).props')" | ||
| /> | ||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.NET.Test.Sdk" /> | ||
| <PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" /> | ||
| <PackageReference Include="xunit.v3" /> | ||
| <PackageReference Include="xunit.runner.visualstudio"> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| </PackageReference> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <ProjectReference Include="$(MSBuildProjectDirectory)\..\$(ProjectName)\$(ProjectName).csproj" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Using Include="Xunit" /> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,14 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <RootNamespace>Cutout.Sample</RootNamespace> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Cutout\Cutout.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/> | ||
| </ItemGroup> | ||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <Nullable>enable</Nullable> | ||
| <RootNamespace>Cutout.Sample</RootNamespace> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <ProjectReference | ||
| Include="..\Cutout\Cutout.csproj" | ||
| OutputItemType="Analyzer" | ||
| ReferenceOutputAssembly="false" | ||
| /> | ||
| </ItemGroup> | ||
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.