Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .codex/hooks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"hooks": [
{
"type": "command",
"command": "bash \"$(git rev-parse --show-toplevel)/.codex/hooks/format-csharp.sh\"",
"command": "bash \"$(jj root)/.codex/hooks/format-csharp.sh\"",
"timeout": 600,
"statusMessage": "Formatting C# with CSharpier"
}
Expand Down
2 changes: 1 addition & 1 deletion .codex/hooks/format-csharp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

set -euo pipefail

root="$(git rev-parse --show-toplevel)"
root="$(jj root)"
dotnet tool restore --tool-manifest "$root/dotnet-tools.json" >/dev/null
dotnet csharpier format "$root"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ publish
[Oo]bj
sql
TestResults
BenchmarkDotNet.Artifacts
*.Cache
ClientBin
stylecop.*
Expand Down
3 changes: 3 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
</PropertyGroup>

<ItemGroup>
<!-- Benchmark dependencies -->
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />

<!-- Runtime dependencies -->
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="9.0.0" />

Expand Down
33 changes: 33 additions & 0 deletions Prexonite.Benchmarks/BenchmarkStackContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Prexonite.Types;

namespace Prexonite.Benchmarks;

internal sealed class BenchmarkStackContext : StackContext
{
readonly PValue _returnValue = PType.Null.CreatePValue();

internal BenchmarkStackContext(Engine engine, Application application)
{
ParentEngine = engine;
ParentApplication = application;
ImportedNamespaces = application.CreateFunction("benchmark-context").ImportedNamespaces;
}

public override Engine ParentEngine { get; }

public override Application ParentApplication { get; }

public override SymbolCollection ImportedNamespaces { get; }

public override PValue ReturnValue => _returnValue;

public override bool TryHandleException(Exception exc)
{
return false;
}

protected override bool PerformNextCycle(StackContext? lastContext)
{
return false;
}
}
Loading
Loading