master 2.44
Tyrrrz 2 weeks ago
parent 7b892c8e5b
commit 0fa5e93f0d

@ -31,7 +31,7 @@ jobs:
- name: Install .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Verify formatting
run: >
@ -56,7 +56,7 @@ jobs:
- name: Install .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Run tests
env:
@ -113,7 +113,7 @@ jobs:
- name: Install .NET
uses: actions/setup-dotnet@3e891b0cb619bf60e2c25674b222b8940e2c1c25 # v4.1.0
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Publish app
run: >

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<Version>999.9.9-dev</Version>
<Company>Tyrrrz</Company>
<Copyright>Copyright (c) Oleksii Holub</Copyright>

@ -1,7 +1,7 @@
# -- Build
# Specify the platform here so that we pull the SDK image matching the host platform,
# instead of the target platform specified during build by the `--platform` option.
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build
# Expose the target architecture set by the `docker build --platform` option, so that
# we can build the assembly for the correct platform.
@ -30,7 +30,7 @@ RUN dotnet publish DiscordChatExporter.Cli \
# -- Run
# Use `runtime-deps` instead of `runtime` because we have a self-contained assembly
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:8.0-alpine AS run
FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:9.0-alpine AS run
LABEL org.opencontainers.image.title="DiscordChatExporter.Cli"
LABEL org.opencontainers.image.description="DiscordChatExporter is an application that can be used to export message history from any Discord channel to a file."

@ -3,12 +3,9 @@
namespace DiscordChatExporter.Core.Markdown.Parsing;
internal class AggregateMatcher<TContext, TValue>(
IReadOnlyList<IMatcher<TContext, TValue>> matchers
params IReadOnlyList<IMatcher<TContext, TValue>> matchers
) : IMatcher<TContext, TValue>
{
public AggregateMatcher(params IMatcher<TContext, TValue>[] matchers)
: this((IReadOnlyList<IMatcher<TContext, TValue>>)matchers) { }
public ParsedMatch<TValue>? TryMatch(TContext context, StringSegment segment)
{
ParsedMatch<TValue>? earliestMatch = null;
@ -28,7 +25,9 @@ internal class AggregateMatcher<TContext, TValue>(
earliestMatch is null
|| match.Segment.StartIndex < earliestMatch.Segment.StartIndex
)
{
earliestMatch = match;
}
// If the earliest match starts at the very beginning - break,
// because it's impossible to find a match earlier than that

Loading…
Cancel
Save