From ba44b349eaebea0f036b850ac4a6dfb9f62e209a Mon Sep 17 00:00:00 2001 From: rameel Date: Thu, 19 Nov 2026 16:17:08 +0500 Subject: [PATCH 1/3] docs: put a space before /> in XML doc tags Co-Authored-By: Claude Opus 5.5 --- src/Ramstack.ExpressionParser/Binder.cs | 48 +++++++------- .../ContextAwareBinder.cs | 6 +- .../DefaultBinder.cs | 10 +-- .../ExpressionBuilder.Helpers.cs | 10 +-- .../ExpressionBuilder.cs | 4 +- .../ExpressionParser.Parser.cs | 4 +- .../ExpressionParser.cs | 24 +++---- .../Expressions/Expr.Binary.cs | 8 +-- .../Expressions/Expr.Call.cs | 8 +-- .../Expressions/Expr.Conditional.cs | 8 +-- .../Expressions/Expr.Index.cs | 4 +- .../Expressions/Expr.MemberAccess.cs | 4 +- .../Expressions/Expr.Parenthesized.cs | 4 +- .../Expressions/Expr.Reference.cs | 2 +- .../Expressions/Expr.Unary.cs | 24 +++---- .../Expressions/Expr.cs | 12 ++-- .../Expressions/ExprVisitor.cs | 46 ++++++------- .../Internal/Error.cs | 64 +++++++++---------- .../Internal/ReflectionExtensions.cs | 48 +++++++------- .../Internal/TypeUtils.cs | 36 +++++------ .../ParseErrorException.cs | 6 +- .../Parsers/StackGuardParser.cs | 2 +- 22 files changed, 191 insertions(+), 191 deletions(-) diff --git a/src/Ramstack.ExpressionParser/Binder.cs b/src/Ramstack.ExpressionParser/Binder.cs index 44001dc..08c10ae 100644 --- a/src/Ramstack.ExpressionParser/Binder.cs +++ b/src/Ramstack.ExpressionParser/Binder.cs @@ -12,10 +12,10 @@ public abstract class Binder /// Gets the expression whose instance members can be referenced in an expression without qualification. /// /// - /// The context expression, or if the binder has no context. + /// The context expression, or if the binder has no context. /// /// - /// When or returns an instance member + /// When or returns an instance member /// for an unqualified name, the member is accessed through this expression. /// public virtual Expression? Context => null; @@ -23,48 +23,48 @@ public abstract class Binder /// /// Resolves the type associated with the specified name. /// - /// The representing the name of the requested type. + /// The representing the name of the requested type. /// - /// The instance corresponding to the specified - /// if resolved successfully; otherwise, . + /// The instance corresponding to the specified + /// if resolved successfully; otherwise, . /// public abstract Type? BindToType(Identifier name); /// /// Attempts to bind to a method based on the specified type, method name, and parameter types. /// - /// The from which to select the method, - /// or for an unqualified method name. - /// The representing the name of the method to bind. - /// An array of objects representing + /// The from which to select the method, + /// or for an unqualified method name. + /// The representing the name of the method to bind. + /// An array of objects representing /// the types of arguments passed to the method. - /// A indicating whether to match only static methods - /// () or instance methods (). + /// A indicating whether to match only static methods + /// () or instance methods (). /// - /// A representing the matching method if found; otherwise, . + /// A representing the matching method if found; otherwise, . /// /// - /// For an unqualified method name, is and - /// is . The binder can then return a static method of a type whose members are available - /// without qualification, or an instance method of the type of . + /// For an unqualified method name, is and + /// is . The binder can then return a static method of a type whose members are available + /// without qualification, or an instance method of the type of . /// public abstract MethodInfo? BindToMethod(Type? type, Identifier methodName, Type[] parameterTypes, bool isStatic); /// /// Attempts to bind to a member (field or property) based on the specified type and member name. /// - /// The from which to select the member, - /// or for an unqualified member name. - /// The representing the name of the member to bind. - /// A indicating whether to match only static members - /// () or instance members (). + /// The from which to select the member, + /// or for an unqualified member name. + /// The representing the name of the member to bind. + /// A indicating whether to match only static members + /// () or instance members (). /// - /// A representing the matching member if found; otherwise, . + /// A representing the matching member if found; otherwise, . /// /// - /// For an unqualified member name, is and - /// is . The binder can then return a static member of a type whose members are available - /// without qualification, or an instance member of the type of . + /// For an unqualified member name, is and + /// is . The binder can then return a static member of a type whose members are available + /// without qualification, or an instance member of the type of . /// public abstract MemberInfo? BindToMember(Type? type, Identifier memberName, bool isStatic); } diff --git a/src/Ramstack.ExpressionParser/ContextAwareBinder.cs b/src/Ramstack.ExpressionParser/ContextAwareBinder.cs index d0e076f..87cb343 100644 --- a/src/Ramstack.ExpressionParser/ContextAwareBinder.cs +++ b/src/Ramstack.ExpressionParser/ContextAwareBinder.cs @@ -15,7 +15,7 @@ public class ContextAwareBinder : DefaultBinder public override Expression Context => _context; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// The expression whose members can be referenced without qualification. public ContextAwareBinder(Expression context) @@ -28,7 +28,7 @@ public ContextAwareBinder(Expression context) /// /// - /// For an unqualified member name, the instance members of take precedence + /// For an unqualified member name, the instance members of take precedence /// over the static members of the types imported into scope. /// public override MemberInfo? BindToMember(Type? type, Identifier memberName, bool isStatic) @@ -45,7 +45,7 @@ public ContextAwareBinder(Expression context) /// /// - /// For an unqualified method name, the instance methods of take precedence + /// For an unqualified method name, the instance methods of take precedence /// over the static methods of the types imported into scope. /// public override MethodInfo? BindToMethod(Type? type, Identifier methodName, Type[] parameterTypes, bool isStatic) diff --git a/src/Ramstack.ExpressionParser/DefaultBinder.cs b/src/Ramstack.ExpressionParser/DefaultBinder.cs index c0636f7..1b8dec9 100644 --- a/src/Ramstack.ExpressionParser/DefaultBinder.cs +++ b/src/Ramstack.ExpressionParser/DefaultBinder.cs @@ -8,7 +8,7 @@ namespace Ramstack.Parsing; /// /// Represents the default binder, which resolves a predefined set of common .NET types -/// and the types registered with . +/// and the types registered with . /// /// /// Names of types, members, and methods are matched without regard to case. @@ -86,12 +86,12 @@ public class DefaultBinder : Binder /// /// Registers a custom type for use in binding operations, allowing it to be resolved by name. /// - /// The to register for binding. - /// A indicating whether the static members of the type + /// The to register for binding. + /// A indicating whether the static members of the type /// can be referenced without the type name, as with a using static directive - /// (default is ). + /// (default is ). /// - /// The type is registered under its simple name, , without the namespace. + /// The type is registered under its simple name, , without the namespace. /// Registering another type with the same name replaces the earlier registration. /// public void RegisterType(Type type, bool importAsStatic = false) diff --git a/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs b/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs index 2b7e270..b5be8d9 100644 --- a/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs +++ b/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs @@ -42,7 +42,7 @@ private object ResolveSymbol(Expr.Reference expr) /// The expression of the instance, or for a static member. /// The field or property to read. /// - /// The that reads the member. + /// The that reads the member. /// private static MemberExpression CreateMemberAccess(Expression? expression, MemberInfo member) { @@ -97,7 +97,7 @@ private static MemberExpression CreateMemberAccess(Expression? expression, Membe /// Converts the branches of a conditional expression to their common type. /// /// - /// As in C#, the common type is the type of one of the branches, so it is only + /// As in C#, the common type is the type of one of the branches, so it is only /// when a branch is of that type, for example after an explicit conversion. The null literal takes the type /// of the other branch if that type accepts . /// @@ -159,7 +159,7 @@ static bool CanBeNull(Type type) => /// /// Creates a null-coalescing expression whose operands are converted to its result type. /// - /// The representing the operator. + /// The representing the operator. /// The expression of the left operand. /// The expression of the right operand. /// @@ -582,9 +582,9 @@ private static Expression ApplyBinaryExpression(Identifier op, Func /// The expression of the operand. /// The non-nullable value type to convert to. - /// to convert to the nullable form of . + /// to convert to the nullable form of . /// - /// The converted expression, or if it is already of the resulting type. + /// The converted expression, or if it is already of the resulting type. /// private static Expression ConvertOperand(Expression operand, Type type, bool lifted) { diff --git a/src/Ramstack.ExpressionParser/ExpressionBuilder.cs b/src/Ramstack.ExpressionParser/ExpressionBuilder.cs index 52f8928..163c304 100644 --- a/src/Ramstack.ExpressionParser/ExpressionBuilder.cs +++ b/src/Ramstack.ExpressionParser/ExpressionBuilder.cs @@ -6,7 +6,7 @@ namespace Ramstack.Parsing; /// -/// Represents a visitor that builds an from an tree. +/// Represents a visitor that builds an from an tree. /// /// The binder that resolves the types, members, and methods referenced in the expression. public partial class ExpressionBuilder(Binder binder) : ExprVisitor @@ -19,7 +19,7 @@ public partial class ExpressionBuilder(Binder binder) : ExprVisitor /// /// /// Errors in the expression, such as a name that cannot be resolved or an operator that cannot be applied - /// to its operands, are reported by throwing a . The exception is also thrown + /// to its operands, are reported by throwing a . The exception is also thrown /// if the thread's stack is too small to visit the expression safely. /// public override Expression Visit(Expr expr) diff --git a/src/Ramstack.ExpressionParser/ExpressionParser.Parser.cs b/src/Ramstack.ExpressionParser/ExpressionParser.Parser.cs index 0720bfc..673f062 100644 --- a/src/Ramstack.ExpressionParser/ExpressionParser.Parser.cs +++ b/src/Ramstack.ExpressionParser/ExpressionParser.Parser.cs @@ -21,7 +21,7 @@ partial class ExpressionParser /// Gets the expression parser that does not require the expression to extend to the end of the input. /// /// - /// Unlike , this parser leaves the input that follows the expression unconsumed, + /// Unlike , this parser leaves the input that follows the expression unconsumed, /// so it can be used as part of a larger grammar. /// Parsing stops with a fatal error if the expression tree is deeper than 256 levels. /// Each operator, member access, call, indexer, and pair of parentheses adds a level, @@ -296,7 +296,7 @@ static Expr HijackMemberExpression(Expr result, Expr value) } /// - /// Stops parsing with a fatal error if the specified expression tree is deeper than . + /// Stops parsing with a fatal error if the specified expression tree is deeper than . /// /// The expression tree to check. /// diff --git a/src/Ramstack.ExpressionParser/ExpressionParser.cs b/src/Ramstack.ExpressionParser/ExpressionParser.cs index 834df33..f3d4e3f 100644 --- a/src/Ramstack.ExpressionParser/ExpressionParser.cs +++ b/src/Ramstack.ExpressionParser/ExpressionParser.cs @@ -8,7 +8,7 @@ namespace Ramstack.Parsing; public static partial class ExpressionParser { /// - /// Parses the specified expression into an . + /// Parses the specified expression into an . /// /// The expression string to parse. /// @@ -18,7 +18,7 @@ public static ParseResult Parse(ReadOnlySpan source) => Parse(source, new ExpressionBuilder(new DefaultBinder())); /// - /// Parses the specified expression into an using the specified . + /// Parses the specified expression into an using the specified . /// /// The expression string to parse. /// The binder that resolves the types, members, and methods referenced in the expression. @@ -29,7 +29,7 @@ public static ParseResult Parse(ReadOnlySpan source, Binder bi Parse(source, new ExpressionBuilder(binder)); /// - /// Parses the specified expression into an using the specified . + /// Parses the specified expression into an using the specified . /// /// The expression string to parse. /// The expression builder responsible for constructing the expression tree. @@ -85,7 +85,7 @@ public static ParseResult Parse(ReadOnlySpan source, Expressio /// The evaluated result. /// /// - /// If the expression is invalid, an that describes the error is thrown. + /// If the expression is invalid, an that describes the error is thrown. /// public static object? Evaluate(ReadOnlySpan source) => Evaluate(source); @@ -99,8 +99,8 @@ public static ParseResult Parse(ReadOnlySpan source, Expressio /// The evaluated result. /// /// - /// The expression can access the members of the runtime type of . - /// If the expression is invalid, an that describes the error is thrown. + /// The expression can access the members of the runtime type of . + /// If the expression is invalid, an that describes the error is thrown. /// public static object? Evaluate(ReadOnlySpan source, object context) { @@ -133,10 +133,10 @@ public static ParseResult Parse(ReadOnlySpan source, Expressio /// The expected result type. /// The expression string to evaluate. /// - /// The evaluated result of type . + /// The evaluated result of type . /// /// - /// If the expression is invalid, an that describes the error is thrown. + /// If the expression is invalid, an that describes the error is thrown. /// public static TResult? Evaluate(ReadOnlySpan source) { @@ -164,12 +164,12 @@ public static ParseResult Parse(ReadOnlySpan source, Expressio /// The expression string to evaluate. /// The evaluation context. /// - /// The evaluated result of type . + /// The evaluated result of type . /// /// - /// The expression can access the members of , not of the runtime type - /// of . Members declared only in a derived or implementing type are not available. - /// If the expression is invalid, an that describes the error is thrown. + /// The expression can access the members of , not of the runtime type + /// of . Members declared only in a derived or implementing type are not available. + /// If the expression is invalid, an that describes the error is thrown. /// public static TResult? Evaluate(ReadOnlySpan source, TContext context) where TContext : notnull { diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs index 210fd3c..11a02cf 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs @@ -12,7 +12,7 @@ public sealed class Binary(Identifier @operator, Expr lhs, Expr rhs) /// Gets the operator of the binary expression. /// /// - /// An representing the operator, such as "+" or "-". + /// An representing the operator, such as "+" or "-". /// public Identifier Operator { get; } = @operator; @@ -29,9 +29,9 @@ public sealed class Binary(Identifier @operator, Expr lhs, Expr rhs) /// /// Deconstructs the binary expression into its operator and operands. /// - /// The representing the operator of the binary expression. - /// The representing the left-hand side operand. - /// The representing the right-hand side operand. + /// The representing the operator of the binary expression. + /// The representing the left-hand side operand. + /// The representing the right-hand side operand. public void Deconstruct(out Identifier @operator, out Expr lhs, out Expr rhs) => (@operator, lhs, rhs) = (Operator, Left, Right); diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs index 7239e13..83f9f27 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs @@ -14,7 +14,7 @@ public sealed class Call(Expr expression, IReadOnlyList parameters) /// Gets the expression that specifies the method or delegate to call. /// /// - /// An representing the target of the call, such as Math.Abs in Math.Abs(-5). + /// An representing the target of the call, such as Math.Abs in Math.Abs(-5). /// public Expr Expression { get; } = expression; @@ -22,7 +22,7 @@ public sealed class Call(Expr expression, IReadOnlyList parameters) /// Gets the arguments passed to the call. /// /// - /// An of instances representing the arguments, + /// An of instances representing the arguments, /// such as -5 in Math.Abs(-5). /// public IReadOnlyList Parameters { get; } = parameters; @@ -30,8 +30,8 @@ public sealed class Call(Expr expression, IReadOnlyList parameters) /// /// Deconstructs the call expression into its target expression and arguments. /// - /// The representing the target of the call. - /// The of instances representing the call's arguments. + /// The representing the target of the call. + /// The of instances representing the call's arguments. public void Deconstruct(out Expr expression, out IReadOnlyList parameters) => (expression, parameters) = (Expression, Parameters); diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs index 057c15d..962e11c 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs @@ -12,7 +12,7 @@ public sealed class Conditional(Expr test, Expr ifTrue, Expr ifFalse) /// Gets the condition expression evaluated to determine the outcome. /// /// - /// An representing the test condition, e.g., a > b. + /// An representing the test condition, e.g., a > b. /// public Expr Test { get; } = test; @@ -29,9 +29,9 @@ public sealed class Conditional(Expr test, Expr ifTrue, Expr ifFalse) /// /// Deconstructs the conditional expression into its test condition and branch expressions. /// - /// The representing the condition to evaluate. - /// The representing the branch. - /// The representing the branch. + /// The representing the condition to evaluate. + /// The representing the branch. + /// The representing the branch. public void Deconstruct(out Expr test, out Expr ifTrue, out Expr ifFalse) => (test, ifTrue, ifFalse) = (Test, IfTrue, IfFalse); diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs index e8f523c..29293c2 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs @@ -21,8 +21,8 @@ public sealed class Indexer(Expr expression, IReadOnlyList parameters) /// /// Deconstructs the indexer expression into its target expression and index arguments. /// - /// The representing the target being indexed. - /// The of instances representing the index arguments. + /// The representing the target being indexed. + /// The of instances representing the index arguments. public void Deconstruct(out Expr expression, out IReadOnlyList parameters) => (expression, parameters) = (Expression, Parameters); diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs index 3428cc2..6b1ae5d 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs @@ -22,8 +22,8 @@ public sealed class MemberAccess(Expr expression, Expr member) /// /// Deconstructs the member access expression into its target expression and member. /// - /// The representing the target object. - /// The representing the accessed member. + /// The representing the target object. + /// The representing the accessed member. public void Deconstruct(out Expr expression, out Expr member) => (expression, member) = (Expression, Member); diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Parenthesized.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Parenthesized.cs index bd21709..7b8de17 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Parenthesized.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Parenthesized.cs @@ -5,7 +5,7 @@ partial class Expr /// /// Represents a parenthesized expression in an expression tree, used to enforce precedence or grouping. /// - /// The enclosed within parentheses. + /// The enclosed within parentheses. public sealed class Parenthesized(Expr expression) : Expr(ExprKind.Parenthesized, expression.Depth + 1) { @@ -17,7 +17,7 @@ public sealed class Parenthesized(Expr expression) /// /// Deconstructs the parenthesized expression into its inner expression. /// - /// The enclosed within parentheses. + /// The enclosed within parentheses. public void Deconstruct(out Expr expression) => expression = Expression; diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs index 1650191..cbfc7ce 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs @@ -15,7 +15,7 @@ public sealed class Reference(Identifier value) : Expr(ExprKind.Reference) /// /// Deconstructs the reference expression into its identifier. /// - /// The representing the referenced entity. + /// The representing the referenced entity. public void Deconstruct(out Identifier value) => value = Value; diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Unary.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Unary.cs index 33180db..9646677 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Unary.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Unary.cs @@ -5,9 +5,9 @@ partial class Expr /// /// Represents a unary operation expression in an expression tree, consisting of an operator and a single operand. /// - /// The representing the unary operator, e.g., "-" or "int". - /// The specifying the kind of unary operation, such as negation or conversion. - /// The on which the unary operation is applied. + /// The representing the unary operator, e.g., "-" or "int". + /// The specifying the kind of unary operation, such as negation or conversion. + /// The on which the unary operation is applied. public sealed class Unary(Identifier @operator, UnaryType unaryType, Expr operand) : Expr(ExprKind.Unary, operand.Depth + 1) { @@ -15,7 +15,7 @@ public sealed class Unary(Identifier @operator, UnaryType unaryType, Expr operan /// Gets the operator of the unary expression. /// /// - /// An representing the unary operator, such as "-" or a type name like "int". + /// An representing the unary operator, such as "-" or a type name like "int". /// public Identifier Operator { get; } = @operator; @@ -23,7 +23,7 @@ public sealed class Unary(Identifier @operator, UnaryType unaryType, Expr operan /// Gets the kind of the unary operation. /// /// - /// A value indicating the kind of operation, such as negation or conversion. + /// A value indicating the kind of operation, such as negation or conversion. /// public UnaryType UnaryType { get; } = unaryType; @@ -31,15 +31,15 @@ public sealed class Unary(Identifier @operator, UnaryType unaryType, Expr operan /// Gets the operand of the unary expression. /// /// - /// An representing the expression the operator is applied to, e.g., x. + /// An representing the expression the operator is applied to, e.g., x. /// public Expr Operand { get; } = operand; /// /// Deconstructs the unary expression into its kind and operand. /// - /// The of the unary operation. - /// The on which the operation is applied. + /// The of the unary operation. + /// The on which the operation is applied. /// /// /// var unary = new Expr.Unary(new Identifier("-"), UnaryType.Negate, new Expr.Reference(new Identifier("x"))); @@ -53,9 +53,9 @@ public void Deconstruct(out UnaryType unaryType, out Expr operand) => /// /// Deconstructs the unary expression into its operator, kind, and operand. /// - /// The representing the unary operator. - /// The of the unary operation. - /// The on which the operation is applied. + /// The representing the unary operator. + /// The of the unary operation. + /// The on which the operation is applied. /// /// /// var unary = new Expr.Unary(new Identifier("-"), UnaryType.Negate, new Expr.Reference(new Identifier("x"))); @@ -68,7 +68,7 @@ public void Deconstruct(out Identifier @operator, out UnaryType unaryType, out E /// /// - /// The result of type produced by the visitor's method. + /// The result of type produced by the visitor's method. /// public override T Accept(ExprVisitor visitor) => visitor.VisitUnary(this); diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.cs index 285fede..b61b890 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.cs @@ -9,7 +9,7 @@ public abstract partial class Expr(ExprKind kind) /// Gets the kind of this expression node. /// /// - /// An value indicating the type of expression, such as a literal, binary operation, or reference. + /// An value indicating the type of expression, such as a literal, binary operation, or reference. /// public ExprKind Kind { get; init; } = kind; @@ -26,7 +26,7 @@ public abstract partial class Expr(ExprKind kind) internal int Depth { get; } = 1; /// - /// Initializes a new instance of the class with the specified kind and depth. + /// Initializes a new instance of the class with the specified kind and depth. /// /// The kind of this expression node. /// The depth of this expression node. @@ -55,17 +55,17 @@ private static int ComputeDepth(Expr expression, IReadOnlyList list) /// /// Deconstructs the expression into its kind. /// - /// The of this expression node. + /// The of this expression node. public void Deconstruct(out ExprKind kind) => kind = Kind; /// - /// Accepts a visitor to process this expression node and return a result of type . + /// Accepts a visitor to process this expression node and return a result of type . /// /// The type of the result produced by the visitor. - /// The instance that processes this expression. + /// The instance that processes this expression. /// - /// A result of type as determined by the visitor's implementation. + /// A result of type as determined by the visitor's implementation. /// public abstract T Accept(ExprVisitor visitor); } diff --git a/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs b/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs index 102f857..02d078a 100644 --- a/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs +++ b/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs @@ -1,17 +1,17 @@ namespace Ramstack.Parsing.Expressions; /// -/// Represents a visitor for trees that produces a result of type . +/// Represents a visitor for trees that produces a result of type . /// /// The type of the result produced by visiting the expression tree nodes. public abstract class ExprVisitor { /// - /// Dispatches the expression to the visit method for its node type by calling . + /// Dispatches the expression to the visit method for its node type by calling . /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by the corresponding visit method. + /// A result of type produced by the corresponding visit method. /// public virtual T Visit(Expr expr) => expr.Accept(this); @@ -21,7 +21,7 @@ public virtual T Visit(Expr expr) => /// /// The expressions to visit. /// - /// The results of visiting the expressions, in the same order as . + /// The results of visiting the expressions, in the same order as . /// public virtual IReadOnlyList Visit(IReadOnlyList nodes) { @@ -38,81 +38,81 @@ public virtual IReadOnlyList Visit(IReadOnlyList nodes) /// /// Visits a reference expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the reference expression. + /// A result of type produced by processing the reference expression. /// protected internal abstract T VisitReference(Expr.Reference expr); /// /// Visits a literal expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the literal expression. + /// A result of type produced by processing the literal expression. /// protected internal abstract T VisitLiteral(Expr.Literal expr); /// /// Visits a binary operation expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the binary expression. + /// A result of type produced by processing the binary expression. /// protected internal abstract T VisitBinary(Expr.Binary expr); /// /// Visits a method call expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the call expression. + /// A result of type produced by processing the call expression. /// protected internal abstract T VisitCall(Expr.Call expr); /// /// Visits an indexer expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the indexer expression. + /// A result of type produced by processing the indexer expression. /// protected internal abstract T VisitIndex(Expr.Indexer expr); /// /// Visits a member access expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the member access expression. + /// A result of type produced by processing the member access expression. /// protected internal abstract T VisitMemberAccess(Expr.MemberAccess expr); /// /// Visits a unary operation expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the unary expression. + /// A result of type produced by processing the unary expression. /// protected internal abstract T VisitUnary(Expr.Unary expr); /// /// Visits a conditional (ternary) expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the conditional expression. + /// A result of type produced by processing the conditional expression. /// protected internal abstract T VisitConditional(Expr.Conditional expr); /// /// Visits a parenthesized expression node. /// - /// The to visit. + /// The to visit. /// - /// A result of type produced by processing the parenthesized expression. + /// A result of type produced by processing the parenthesized expression. /// protected internal abstract T VisitParenthesized(Expr.Parenthesized expr); } diff --git a/src/Ramstack.ExpressionParser/Internal/Error.cs b/src/Ramstack.ExpressionParser/Internal/Error.cs index 08f15ae..793c5cc 100644 --- a/src/Ramstack.ExpressionParser/Internal/Error.cs +++ b/src/Ramstack.ExpressionParser/Internal/Error.cs @@ -8,42 +8,42 @@ namespace Ramstack.Parsing.Internal; internal static class Error { /// - /// Throws a indicating an unresolved symbol. + /// Throws a indicating an unresolved symbol. /// - /// The that could not be resolved. + /// The that could not be resolved. [DoesNotReturn] public static void CannotResolveSymbol(Identifier identifier) => throw new ParseErrorException($"Cannot resolve symbol '{identifier}'."); /// - /// Throws a indicating an identifier was expected. + /// Throws a indicating an identifier was expected. /// - /// The encountered where an identifier was expected. + /// The encountered where an identifier was expected. [DoesNotReturn] public static void IdentifierExpected(Expr expr) => throw new ParseErrorException($"Identifier expected (expression: {expr})."); /// - /// Throws a indicating a method name was expected. + /// Throws a indicating a method name was expected. /// - /// The encountered where a method name was expected. + /// The encountered where a method name was expected. [DoesNotReturn] public static void MethodNameExpected(Expr expr) => throw new ParseErrorException($"Method name expected (expression: {expr})."); /// - /// Throws a indicating a non-invocable member was used like a method. + /// Throws a indicating a non-invocable member was used like a method. /// - /// The representing the non-invocable member. + /// The representing the non-invocable member. [DoesNotReturn] public static void NonInvocableMember(Expr expr) => throw new ParseErrorException($"Non-invocable member '{expr}' cannot be used like a method."); /// - /// Throws a indicating a unary operator cannot be applied to an operand. + /// Throws a indicating a unary operator cannot be applied to an operand. /// - /// The containing the operator. - /// The of the operand. + /// The containing the operator. + /// The of the operand. [DoesNotReturn] public static void NonApplicableUnaryOperator(Expr.Unary expr, Type operandType) { @@ -52,11 +52,11 @@ public static void NonApplicableUnaryOperator(Expr.Unary expr, Type operandType) } /// - /// Throws a indicating a binary operator cannot be applied to its operands. + /// Throws a indicating a binary operator cannot be applied to its operands. /// - /// The representing the binary operator. - /// The of the left operand. - /// The of the right operand. + /// The representing the binary operator. + /// The of the left operand. + /// The of the right operand. [DoesNotReturn] public static void NonApplicableBinaryOperator(Identifier op, Type left, Type right) { @@ -65,11 +65,11 @@ public static void NonApplicableBinaryOperator(Identifier op, Type left, Type ri } /// - /// Throws a indicating the conditional operator cannot be applied to its branches + /// Throws a indicating the conditional operator cannot be applied to its branches /// because they have no common type. /// - /// The of the true branch, or for the null literal. - /// The of the false branch, or for the null literal. + /// The of the true branch, or for the null literal. + /// The of the false branch, or for the null literal. [DoesNotReturn] public static void NonApplicableConditionalOperator(Type? ifTrue, Type? ifFalse) { @@ -78,10 +78,10 @@ public static void NonApplicableConditionalOperator(Type? ifTrue, Type? ifFalse) } /// - /// Throws a indicating an implicit type conversion is not possible. + /// Throws a indicating an implicit type conversion is not possible. /// - /// The source of the operand. - /// The target for the conversion. + /// The source of the operand. + /// The target for the conversion. [DoesNotReturn] public static void MissingImplicitConversion(Type operandType, Type conversionType) { @@ -90,9 +90,9 @@ public static void MissingImplicitConversion(Type operandType, Type conversionTy } /// - /// Throws a indicating indexing cannot be applied to a type. + /// Throws a indicating indexing cannot be applied to a type. /// - /// The that does not support indexing. + /// The that does not support indexing. [DoesNotReturn] public static void NonIndexingType(Type type) { @@ -101,10 +101,10 @@ public static void NonIndexingType(Type type) } /// - /// Throws a indicating a property or indexer cannot be read + /// Throws a indicating a property or indexer cannot be read /// because it has no get accessor. /// - /// The of the property or indexer. + /// The of the property or indexer. [DoesNotReturn] public static void MissingGetAccessor(PropertyInfo property) { @@ -113,10 +113,10 @@ public static void MissingGetAccessor(PropertyInfo property) } /// - /// Throws a indicating a property or indexer cannot be read + /// Throws a indicating a property or indexer cannot be read /// because its get accessor is not public. /// - /// The of the property or indexer. + /// The of the property or indexer. [DoesNotReturn] public static void InaccessibleGetAccessor(PropertyInfo property) { @@ -125,9 +125,9 @@ public static void InaccessibleGetAccessor(PropertyInfo property) } /// - /// Throws a indicating an ambiguous match among multiple candidates. + /// Throws a indicating an ambiguous match among multiple candidates. /// - /// The collection of objects representing ambiguous matches. + /// The collection of objects representing ambiguous matches. [DoesNotReturn] public static void AmbiguousMatch(IEnumerable candidates) { @@ -136,10 +136,10 @@ public static void AmbiguousMatch(IEnumerable candidates) } /// - /// Throws a with a custom error message. + /// Throws a with a custom error message. /// /// The custom error message, or for a default message. - /// Always thrown with the specified . + /// Always thrown with the specified . [DoesNotReturn] public static void Throw(string? message) => throw new ParseErrorException(message); @@ -148,7 +148,7 @@ public static void Throw(string? message) => /// Formats a property as its declaring type and name, or an indexer as its declaring type and parameter types, /// as in T.Name or T.this[System.Int32]. /// - /// The of the property or indexer. + /// The of the property or indexer. /// /// The formatted name. /// diff --git a/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs b/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs index 4d1f240..ed7e2fd 100644 --- a/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs +++ b/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs @@ -3,37 +3,37 @@ namespace Ramstack.Parsing.Internal; /// -/// Provides extension methods for the and classes. +/// Provides extension methods for the and classes. /// internal static class ReflectionExtensions { /// - /// Determines whether the specified type is a type. + /// Determines whether the specified type is a type. /// - /// The to evaluate. + /// The to evaluate. /// - /// if the type is a type; otherwise, . + /// if the type is a type; otherwise, . /// public static bool IsNullable(this Type type) => type.IsGenericType && !type.IsGenericTypeDefinition && type.GetGenericTypeDefinition() == typeof(Nullable<>); /// - /// Returns the underlying type of the specified type, or the type itself for any other type. + /// Returns the underlying type of the specified type, or the type itself for any other type. /// - /// The to evaluate. + /// The to evaluate. /// - /// The underlying type if is a type; - /// otherwise, . + /// The underlying type if is a type; + /// otherwise, . /// public static Type GetNonNullableType(this Type type) => Nullable.GetUnderlyingType(type) ?? type; /// - /// Returns the type for the specified non-nullable value type. + /// Returns the type for the specified non-nullable value type. /// /// The non-nullable value type. /// - /// The type whose underlying type is . + /// The type whose underlying type is . /// public static Type MakeNullableType(this Type type) => typeof(Nullable<>).MakeGenericType(type); @@ -41,7 +41,7 @@ public static Type MakeNullableType(this Type type) => /// /// Determines whether the specified type is declared as static. /// - /// The to evaluate. + /// The to evaluate. /// /// if the type is declared as static; otherwise, . /// @@ -51,17 +51,17 @@ public static bool IsStatic(this Type type) => /// /// Determines whether the specified member is declared as static. /// - /// The instance representing the member to evaluate. + /// The instance representing the member to evaluate. /// /// if the member is declared as static; otherwise, . /// The determination is made as follows: /// - /// For constructors, checks . + /// For constructors, checks . /// For events, checks whether the event's AddMethod is static. - /// For fields, checks . - /// For methods, checks . + /// For fields, checks . + /// For methods, checks . /// For properties, checks whether the property's GetMethod or SetMethod is static. - /// For types (including nested types), checks whether the type is static using . + /// For types (including nested types), checks whether the type is static using . /// /// public static bool IsStatic(this MemberInfo memberInfo) @@ -108,16 +108,16 @@ public static bool IsStatic(this MemberInfo memberInfo) /// /// Determines the type associated with the specified member. /// - /// The instance representing the member to evaluate. + /// The instance representing the member to evaluate. /// - /// The associated with the member, determined as follows: + /// The associated with the member, determined as follows: /// - /// If the member is a field, returns . - /// If the member is a property, returns . - /// If the member is an event, returns . - /// If the member is a method, returns . - /// If the member is a constructor, returns of the constructor. - /// If the member is a type (including nested types), returns the itself. + /// If the member is a field, returns . + /// If the member is a property, returns . + /// If the member is an event, returns . + /// If the member is a method, returns . + /// If the member is a constructor, returns of the constructor. + /// If the member is a type (including nested types), returns the itself. /// /// public static Type GetMemberType(this MemberInfo memberInfo) diff --git a/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs b/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs index bb62f47..8d53112 100644 --- a/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs +++ b/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs @@ -31,15 +31,15 @@ public static class TypeUtils ]; /// - /// Determines whether the is a numeric type. + /// Determines whether the is a numeric type. /// - /// The to test. + /// The to test. /// - /// if is a numeric type; otherwise, . + /// if is a numeric type; otherwise, . /// /// - /// Besides the integer types checked by , the numeric types are - /// , , , and . + /// Besides the integer types checked by , the numeric types are + /// , , , and . /// Enum types are not numeric. /// public static bool IsNumeric(Type type) @@ -70,21 +70,21 @@ public static bool IsNumeric(Type type) /// /// Determines whether the specified type represents an integer type. /// - /// The to evaluate. + /// The to evaluate. /// /// if the type is an integer type (signed or unsigned); otherwise, . /// /// /// This method checks for the following integer types: /// - /// - /// - /// - /// - /// - /// - /// - /// + /// + /// + /// + /// + /// + /// + /// + /// /// /// public static bool IsInteger(Type type) @@ -111,7 +111,7 @@ public static bool IsInteger(Type type) /// /// Determines whether an implicit identity or numeric conversion exists - /// from to . + /// from to . /// /// The type to convert from. /// The type to convert to. @@ -119,7 +119,7 @@ public static bool IsInteger(Type type) /// if the conversion exists; otherwise, . /// /// - /// Only primitive types, , , and are considered; + /// Only primitive types, , , and are considered; /// for other types, including enum types, the method returns . /// public static bool CanConvertPrimitive(Type source, Type target) @@ -147,8 +147,8 @@ public static bool CanConvertPrimitive(Type source, Type target) /// The type to convert from. /// The type to convert to. /// - /// The conversion operator, or if does not declare - /// an implicit conversion to . + /// The conversion operator, or if does not declare + /// an implicit conversion to . /// public static MethodInfo? FindConversionOperator(Type source, Type target) { diff --git a/src/Ramstack.ExpressionParser/ParseErrorException.cs b/src/Ramstack.ExpressionParser/ParseErrorException.cs index f27513f..fb036bf 100644 --- a/src/Ramstack.ExpressionParser/ParseErrorException.cs +++ b/src/Ramstack.ExpressionParser/ParseErrorException.cs @@ -6,7 +6,7 @@ namespace Ramstack.Parsing; public sealed class ParseErrorException : Exception { /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// with a specified error message. /// /// The message that describes the parsing error. @@ -15,12 +15,12 @@ public ParseErrorException(string? message) : base(message) } /// - /// Initializes a new instance of the class + /// Initializes a new instance of the class /// with a specified error message and a reference to the inner exception that caused this exception. /// /// The message that describes the parsing error. /// The exception that caused the current exception, - /// or if no inner exception is specified. + /// or if no inner exception is specified. public ParseErrorException(string? message, Exception? innerException) : base(message, innerException) { } diff --git a/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs b/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs index 2b317c0..51adcc1 100644 --- a/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs +++ b/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs @@ -6,7 +6,7 @@ namespace Ramstack.Parsing.Parsers; /// /// /// Wrap the parser through which a recursive grammar re-enters itself, so that deeply nested input -/// produces a parse error instead of a . +/// produces a parse error instead of a . /// /// The type of the value produced by the underlying parser. /// The underlying parser. From 8f5d7760fb170a913ae19e0dfc49eefcbdd950e5 Mon Sep 17 00:00:00 2001 From: rameel Date: Thu, 19 Nov 2026 16:17:18 +0500 Subject: [PATCH 2/3] docs: document the parameters of primary constructors Co-Authored-By: Claude Opus 5.5 --- src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs | 3 +++ src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs | 2 ++ src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs | 3 +++ src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs | 2 ++ src/Ramstack.ExpressionParser/Expressions/Expr.Literal.cs | 1 + src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs | 2 ++ src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs | 1 + src/Ramstack.ExpressionParser/Expressions/Expr.cs | 1 + src/Ramstack.ExpressionParser/Expressions/Identifier.cs | 3 ++- 9 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs index 11a02cf..77c5b6f 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Binary.cs @@ -5,6 +5,9 @@ partial class Expr /// /// Represents a binary operation expression in an expression tree, consisting of an operator and two operands. /// + /// The representing the operator of the binary expression. + /// The representing the left-hand side operand. + /// The representing the right-hand side operand. public sealed class Binary(Identifier @operator, Expr lhs, Expr rhs) : Expr(ExprKind.Binary, Math.Max(lhs.Depth, rhs.Depth) + 1) { diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs index 83f9f27..3b3d6f2 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs @@ -5,6 +5,8 @@ partial class Expr /// /// Represents a method or delegate call in an expression tree, consisting of a target expression and its arguments. /// + /// The representing the target of the call. + /// The of instances representing the call's arguments. [SuppressMessage("Naming", "CA1716:Identifiers should not match keywords", Justification = "The type is named after the ExprKind.Call expression kind, and renaming it would break the public API.")] public sealed class Call(Expr expression, IReadOnlyList parameters) diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs index 962e11c..6062ae3 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Conditional.cs @@ -5,6 +5,9 @@ partial class Expr /// /// Represents a conditional (ternary) expression in an expression tree. /// + /// The representing the condition to evaluate. + /// The representing the branch. + /// The representing the branch. public sealed class Conditional(Expr test, Expr ifTrue, Expr ifFalse) : Expr(ExprKind.Conditional, Math.Max(test.Depth, Math.Max(ifTrue.Depth, ifFalse.Depth)) + 1) { diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs index 29293c2..9765754 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs @@ -5,6 +5,8 @@ partial class Expr /// /// Represents an indexing operation in an expression tree, such as accessing an array or a parameterized property. /// + /// The representing the target being indexed. + /// The of instances representing the index arguments. public sealed class Indexer(Expr expression, IReadOnlyList parameters) : Expr(ExprKind.Index, ComputeDepth(expression, parameters)) { diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Literal.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Literal.cs index 2ad53d3..30423fc 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Literal.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Literal.cs @@ -6,6 +6,7 @@ partial class Expr /// Represents a literal value in an expression tree, such as a number, a string, a character, /// a Boolean value, or . /// + /// The constant value of the literal, which may be . public sealed class Literal(object? value) : Expr(ExprKind.Literal) { /// diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs index 6b1ae5d..eb3f111 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.MemberAccess.cs @@ -6,6 +6,8 @@ partial class Expr /// Represents a member access operation in an expression tree, /// such as accessing a field or property like obj.Property. /// + /// The representing the target object. + /// The representing the accessed member. public sealed class MemberAccess(Expr expression, Expr member) : Expr(ExprKind.MemberAccess, Math.Max(expression.Depth, member.Depth) + 1) { diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs index cbfc7ce..aee6782 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Reference.cs @@ -5,6 +5,7 @@ partial class Expr /// /// Represents a reference to a type or member by its name in an expression tree. /// + /// The representing the referenced entity. public sealed class Reference(Identifier value) : Expr(ExprKind.Reference) { /// diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.cs index b61b890..4488ad2 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Expr.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Expr.cs @@ -3,6 +3,7 @@ namespace Ramstack.Parsing.Expressions; /// /// Represents a node in an expression tree, serving as the base class for all expression types. /// +/// The kind of this expression node. public abstract partial class Expr(ExprKind kind) { /// diff --git a/src/Ramstack.ExpressionParser/Expressions/Identifier.cs b/src/Ramstack.ExpressionParser/Expressions/Identifier.cs index 269a6da..47c6f08 100644 --- a/src/Ramstack.ExpressionParser/Expressions/Identifier.cs +++ b/src/Ramstack.ExpressionParser/Expressions/Identifier.cs @@ -4,6 +4,7 @@ namespace Ramstack.Parsing.Expressions; /// Represents a name in an expression: an identifier, such as a member or type name, /// or an operator, such as + or ??. /// +/// The name of the identifier or the symbol of the operator. public sealed class Identifier(string name) { /// @@ -14,7 +15,7 @@ public sealed class Identifier(string name) /// /// Deconstructs the identifier into its name. /// - /// The name of the identifier. + /// The name of the identifier or the symbol of the operator. public void Deconstruct(out string name) => name = Name; From 40cea76969d99d588d1254907a123442bcf7c88b Mon Sep 17 00:00:00 2001 From: rameel Date: Thu, 19 Nov 2026 16:17:18 +0500 Subject: [PATCH 3/3] docs: order XML doc tags consistently Co-Authored-By: Claude Opus 5.5 --- .../ExpressionBuilder.Helpers.cs | 10 +++++----- .../Parsers/StackGuardParser.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs b/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs index b5be8d9..eaac1d9 100644 --- a/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs +++ b/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs @@ -96,17 +96,17 @@ private static MemberExpression CreateMemberAccess(Expression? expression, Membe /// /// Converts the branches of a conditional expression to their common type. /// - /// - /// As in C#, the common type is the type of one of the branches, so it is only - /// when a branch is of that type, for example after an explicit conversion. The null literal takes the type - /// of the other branch if that type accepts . - /// /// The conditional expression. /// The expression of the true branch. /// The expression of the false branch. /// /// The common type of the branches. /// + /// + /// As in C#, the common type is the type of one of the branches, so it is only + /// when a branch is of that type, for example after an explicit conversion. The null literal takes the type + /// of the other branch if that type accepts . + /// private static Type ApplyConditionalConversions(Expr.Conditional expr, ref Expression ifTrue, ref Expression ifFalse) { var isTrueNull = IsNullLiteral(expr.IfTrue); diff --git a/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs b/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs index 51adcc1..7375218 100644 --- a/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs +++ b/src/Ramstack.ExpressionParser/Parsers/StackGuardParser.cs @@ -4,12 +4,12 @@ namespace Ramstack.Parsing.Parsers; /// Represents a parser that stops parsing with a fatal error when the thread's stack /// is too small to run the underlying parser safely. /// +/// The type of the value produced by the underlying parser. +/// The underlying parser. /// /// Wrap the parser through which a recursive grammar re-enters itself, so that deeply nested input /// produces a parse error instead of a . /// -/// The type of the value produced by the underlying parser. -/// The underlying parser. internal sealed class StackGuardParser(Parser parser) : Parser { ///