diff --git a/src/Ramstack.ExpressionParser/Binder.cs b/src/Ramstack.ExpressionParser/Binder.cs
index 6ca6bfa..eb49e26 100644
--- a/src/Ramstack.ExpressionParser/Binder.cs
+++ b/src/Ramstack.ExpressionParser/Binder.cs
@@ -33,8 +33,7 @@ public abstract class Binder
/// A indicating whether to match only static methods
/// () or instance methods ().
///
- /// A representing the matching method if found; otherwise,
- /// if no suitable method is identified.
+ /// A representing the matching method if found; otherwise, .
///
public abstract MethodInfo? BindToMethod(Type? type, Identifier methodName, Type[] parameterTypes, bool isStatic);
@@ -46,8 +45,7 @@ public abstract class Binder
/// A indicating whether to match only static members
/// () or instance members ().
///
- /// A representing the matching member if found; otherwise,
- /// if no suitable member is identified.
+ /// A representing the matching member if found; otherwise, .
///
public abstract MemberInfo? BindToMember(Type? type, Identifier memberName, bool isStatic);
}
diff --git a/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs b/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs
index a53fb8c..2b7e270 100644
--- a/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs
+++ b/src/Ramstack.ExpressionParser/ExpressionBuilder.Helpers.cs
@@ -251,7 +251,9 @@ private static bool IsZeroLiteral(Expr expr)
///
/// Converts the integer literal 0 opposite an operand of an enum type to that enum type
- /// if the operator is defined for two operands of the enum type.
+ /// if the operator is defined for two operands of the enum type. As in the C# compiler, a literal
+ /// of the underlying type on the right of - is left unchanged, so x - 0 returns
+ /// the enum type rather than the underlying type.
///
/// The binary expression.
/// The expression of the left operand.
diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs
index 81282c7..7239e13 100644
--- a/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs
+++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Call.cs
@@ -3,7 +3,7 @@ namespace Ramstack.Parsing.Expressions;
partial class Expr
{
///
- /// Represents a method call expression in an expression tree, consisting of a target expression and its parameters.
+ /// Represents a method or delegate call in an expression tree, consisting of a target expression and its 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.")]
@@ -11,26 +11,27 @@ public sealed class Call(Expr expression, IReadOnlyList parameters)
: Expr(ExprKind.Call, ComputeDepth(expression, parameters))
{
///
- /// Gets the expression being called, such as a method or function reference.
+ /// Gets the expression that specifies the method or delegate to call.
///
///
- /// An representing the target of the call, e.g., Math.Abs.
+ /// An representing the target of the call, such as Math.Abs in Math.Abs(-5).
///
public Expr Expression { get; } = expression;
///
- /// Gets the list of parameters passed to the call.
+ /// Gets the arguments passed to the call.
///
///
- /// An of instances representing the arguments, e.g., -5.
+ /// An of instances representing the arguments,
+ /// such as -5 in Math.Abs(-5).
///
public IReadOnlyList Parameters { get; } = parameters;
///
- /// Deconstructs the call expression into its target expression and 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 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.Index.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs
index 810b30a..e8f523c 100644
--- a/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs
+++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Index.cs
@@ -9,20 +9,20 @@ public sealed class Indexer(Expr expression, IReadOnlyList parameters)
: Expr(ExprKind.Index, ComputeDepth(expression, parameters))
{
///
- /// Gets the expression being indexed, such as an array or object with an indexer.
+ /// Gets the expression being indexed, such as an array or an object with an indexer.
///
public Expr Expression { get; } = expression;
///
- /// Gets the list of parameters used as indices or arguments for the indexing operation.
+ /// Gets the index arguments of the indexing operation.
///
public IReadOnlyList Parameters { get; } = parameters;
///
- /// Deconstructs the indexer expression into its target expression and index parameters.
+ /// Deconstructs the indexer expression into its target expression and index arguments.
///
/// The representing the target being indexed.
- /// The of instances representing the indices.
+ /// 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.Unary.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.Unary.cs
index 6780a0b..33180db 100644
--- a/src/Ramstack.ExpressionParser/Expressions/Expr.Unary.cs
+++ b/src/Ramstack.ExpressionParser/Expressions/Expr.Unary.cs
@@ -20,7 +20,7 @@ public sealed class Unary(Identifier @operator, UnaryType unaryType, Expr operan
public Identifier Operator { get; } = @operator;
///
- /// Gets the type of the unary operation.
+ /// Gets the kind of the unary operation.
///
///
/// A value indicating the kind of operation, such as negation or conversion.
@@ -36,22 +36,22 @@ public sealed class Unary(Identifier @operator, UnaryType unaryType, Expr operan
public Expr Operand { get; } = operand;
///
- /// Deconstructs the unary expression into its type and operand.
+ /// Deconstructs the unary expression into its kind and operand.
///
/// 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")));
- /// var (type, operand) = unary;
- /// // type is UnaryType.Negate, operand is the reference to x
+ /// var (kind, operand) = unary;
+ /// // kind is UnaryType.Negate, operand is the reference to x
///
///
public void Deconstruct(out UnaryType unaryType, out Expr operand) =>
(unaryType, operand) = (UnaryType, Operand);
///
- /// Deconstructs the unary expression into its operator, type, and operand.
+ /// Deconstructs the unary expression into its operator, kind, and operand.
///
/// The representing the unary operator.
/// The of the unary operation.
@@ -59,8 +59,8 @@ public void Deconstruct(out UnaryType unaryType, out Expr operand) =>
///
///
/// var unary = new Expr.Unary(new Identifier("-"), UnaryType.Negate, new Expr.Reference(new Identifier("x")));
- /// var (op, type, operand) = unary;
- /// // op.Name is "-", type is UnaryType.Negate, operand is the reference to x
+ /// var (op, kind, operand) = unary;
+ /// // op.Name is "-", kind is UnaryType.Negate, operand is the reference to x
///
///
public void Deconstruct(out Identifier @operator, out UnaryType unaryType, out Expr operand) =>
diff --git a/src/Ramstack.ExpressionParser/Expressions/Expr.cs b/src/Ramstack.ExpressionParser/Expressions/Expr.cs
index 50294f8..285fede 100644
--- a/src/Ramstack.ExpressionParser/Expressions/Expr.cs
+++ b/src/Ramstack.ExpressionParser/Expressions/Expr.cs
@@ -55,7 +55,7 @@ private static int ComputeDepth(Expr expression, IReadOnlyList list)
///
/// Deconstructs the expression into its kind.
///
- /// The of this expression node, output as an enumeration value.
+ /// The of this expression node.
public void Deconstruct(out ExprKind kind) =>
kind = Kind;
diff --git a/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs b/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs
index d466a21..102f857 100644
--- a/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs
+++ b/src/Ramstack.ExpressionParser/Expressions/ExprVisitor.cs
@@ -1,7 +1,7 @@
namespace Ramstack.Parsing.Expressions;
///
-/// Represents a visitor or rewriter for expression 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
@@ -17,15 +17,12 @@ public virtual T Visit(Expr expr) =>
expr.Accept(this);
///
- /// Visits a list of expressions and returns a collection of results.
+ /// Visits each expression in the list in order and returns the results.
///
- /// The of instances to visit.
+ /// The expressions to visit.
///
- /// An containing the results of type for each visited expression.
+ /// The results of visiting the expressions, in the same order as .
///
- ///
- /// Returns an empty list if is empty; otherwise, visits each expression in sequence.
- ///
public virtual IReadOnlyList Visit(IReadOnlyList nodes)
{
if (nodes.Count == 0)
diff --git a/src/Ramstack.ExpressionParser/Expressions/Identifier.cs b/src/Ramstack.ExpressionParser/Expressions/Identifier.cs
index d930c19..cc0736f 100644
--- a/src/Ramstack.ExpressionParser/Expressions/Identifier.cs
+++ b/src/Ramstack.ExpressionParser/Expressions/Identifier.cs
@@ -11,9 +11,9 @@ public sealed class Identifier(string name)
public string Name { get; } = name;
///
- /// Deconstructs the identifier into its constituent name.
+ /// Deconstructs the identifier into its name.
///
- /// The name of the identifier, output as a string.
+ /// The name of the identifier.
public void Deconstruct(out string name) =>
name = Name;
diff --git a/src/Ramstack.ExpressionParser/Expressions/UnaryType.cs b/src/Ramstack.ExpressionParser/Expressions/UnaryType.cs
index 08d3ca1..cf400cc 100644
--- a/src/Ramstack.ExpressionParser/Expressions/UnaryType.cs
+++ b/src/Ramstack.ExpressionParser/Expressions/UnaryType.cs
@@ -6,10 +6,10 @@ namespace Ramstack.Parsing.Expressions;
public enum UnaryType
{
///
- /// Represents a type cast or conversion operation, such as converting a value to a specific type.
+ /// Represents an explicit conversion of the operand to a type.
///
///
- /// In the expression x :> int, this indicates a conversion of x to an integer.
+ /// In the expression x :> int, this indicates a conversion of x to int.
///
Convert,
diff --git a/src/Ramstack.ExpressionParser/Internal/Error.cs b/src/Ramstack.ExpressionParser/Internal/Error.cs
index 59d1722..08f15ae 100644
--- a/src/Ramstack.ExpressionParser/Internal/Error.cs
+++ b/src/Ramstack.ExpressionParser/Internal/Error.cs
@@ -3,7 +3,7 @@
namespace Ramstack.Parsing.Internal;
///
-/// Provides helper methods for throwing exceptions during expression parsing to simplify error handling.
+/// Provides helper methods for throwing exceptions during expression parsing.
///
internal static class Error
{
diff --git a/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs b/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs
index 5c93fd2..4d1f240 100644
--- a/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs
+++ b/src/Ramstack.ExpressionParser/Internal/ReflectionExtensions.cs
@@ -3,7 +3,7 @@
namespace Ramstack.Parsing.Internal;
///
-/// Provides reflection based extension methods.
+/// Provides extension methods for the and classes.
///
internal static class ReflectionExtensions
{
diff --git a/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs b/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs
index a0a4ec8..bb62f47 100644
--- a/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs
+++ b/src/Ramstack.ExpressionParser/Internal/TypeUtils.cs
@@ -35,8 +35,13 @@ public static class TypeUtils
///
/// The to test.
///
- /// A value indicating whether the is a numeric type.
+ /// if is a numeric type; otherwise, .
///
+ ///
+ /// Besides the integer types checked by , the numeric types are
+ /// , , , and .
+ /// Enum types are not numeric.
+ ///
public static bool IsNumeric(Type type)
{
if (!type.IsEnum)
@@ -105,13 +110,18 @@ public static bool IsInteger(Type type)
///
- /// Determines whether the can convert to the .
+ /// Determines whether an implicit identity or numeric conversion exists
+ /// from to .
///
/// The type to convert from.
/// The type to convert to.
///
- /// A value indicating whether the conversion is possible.
+ /// if the conversion exists; otherwise, .
///
+ ///
+ /// Only primitive types, , , and are considered;
+ /// for other types, including enum types, the method returns .
+ ///
public static bool CanConvertPrimitive(Type source, Type target)
{
//
diff --git a/src/Ramstack.ExpressionParser/Parsers/ConstantNumberParser.cs b/src/Ramstack.ExpressionParser/Parsers/ConstantNumberParser.cs
index 402736d..b9d6e32 100644
--- a/src/Ramstack.ExpressionParser/Parsers/ConstantNumberParser.cs
+++ b/src/Ramstack.ExpressionParser/Parsers/ConstantNumberParser.cs
@@ -1,21 +1,17 @@
namespace Ramstack.Parsing.Parsers;
///
-/// Represents a parser for numeric literals following C# syntax rules.
+/// Represents a parser for numeric literals in C# syntax, except for digit separators
+/// and real literals that start with a decimal point, such as .5.
///
///
-/// This parser only matches the number itself, since the unary sign
-/// is intercepted by the parser responsible for unary operations.
+/// This parser matches only the number itself; a leading sign is parsed as a unary operator.
///
internal sealed class ConstantNumberParser : Parser