Skip to main content
ANcpLua.Roslyn.Utilities provides utilities for building Roslyn analyzers and source generators.

What’s New in v1.42

Performance namespace — seven zero-allocation primitives for netstandard2.0:
  • BitHelpersPopCount, LeadingZeroCount, Log2, RoundUpToPowerOf2, rotations
  • AsciiSet — 128-bit bitmap for O(1) character membership
  • AsciiHelpers — branchless EqualsIgnoreCase, TrimWhiteSpace, IsAscii
  • SpanHelpersCount, ContainsAny, IndexOfAny, IsWhiteSpace for spans
  • IntegerParserTryParseInt32/TryParseInt64 from ReadOnlySpan<char> and ReadOnlySpan<byte>
  • SpanTokenizerref struct allocation-free tokenizer with foreach support
  • MemoryHelpersAsBytes, Cast, GetReference wrappers for MemoryMarshal
Directory restructure — projects moved from ANcpLua.Roslyn.Utilities/ to src/ subfolder.

What’s New in v1.19

Expanded Guard API - Comprehensive argument validation:
  • Collections: NoDuplicates() for duplicate detection
  • File System: FileExists(), DirectoryExists(), ValidFileName(), ValidPath(), ValidExtension(), NormalizedExtension()
  • Type Validation: DefinedEnum(), NotNullableType(), AssignableTo<T>(), AssignableFrom<T>()
  • Member Validation: NotNullWithMember(), MemberNotNull() for object + member validation
  • Numeric: NotZero, NotNegative, Positive, NotGreaterThan, NotLessThan, LessThan, GreaterThan (int/long/double/decimal)
  • Double-specific: NotNaN(), Finite() for floating-point edge cases
  • Unreachable Code: Unreachable(), Unreachable<T>() with caller info capture
All numeric methods use [MethodImpl(AggressiveInlining)] for hot paths.

What’s New in v1.18

API cleanup - Tightened public surface, renamed methods for clarity:
  • Guard.NotNullOr* renamed to Guard.NotNullOrElse* with new lazy Func<T> overloads
  • IndentedStringBuilder.Indent()/Outdent() made private (use BeginBlock())
  • Helper extensions reorganized: NullableExtensions, ObjectExtensions, TryExtensions
  • Redundant nullability attributes and operators removed

Install

Layer 0 Package: This package cannot depend on ANcpLua.NET.Sdk (circular dependency). Uses Microsoft.NET.Sdk with built-in polyfills.

Packages

Features

Quick Example