diff --git a/.gitignore b/.gitignore index 5627e5f..b9e2e93 100644 --- a/.gitignore +++ b/.gitignore @@ -409,4 +409,3 @@ FodyWeavers.xsd /src/core/cocor/Scanner.cs.old /src/core/cocor/Parser.cs /src/core/cocor/Scanner.cs -/src/.github diff --git a/src/Core/FunctionArgument.cs b/src/Core/FunctionArgument.cs index 2ae72b9..80b5d6f 100644 --- a/src/Core/FunctionArgument.cs +++ b/src/Core/FunctionArgument.cs @@ -6,32 +6,15 @@ using System.Threading.Tasks; namespace CSMic { - /// An encapsulated function argument. public class FunctionArgument { - #region Properties - - /// Gets or sets the name. - /// The name. public string Name { get; set; } - - /// Gets or sets the value. - /// The value. public FunctionValue Value { get; set; } - #endregion - - #region Constructors - - /// Constructor. - /// The name. - /// The fv. - public FunctionArgument(string name, FunctionValue fv) + public FunctionArgument(string name, FunctionValue fv) { this.Name = name; this.Value = fv; - } - - #endregion + } } } diff --git a/src/Core/FunctionValue.cs b/src/Core/FunctionValue.cs index a1dee1c..e40a5dc 100644 --- a/src/Core/FunctionValue.cs +++ b/src/Core/FunctionValue.cs @@ -7,77 +7,28 @@ using System.Threading.Tasks; namespace CSMic { - /// An encapsulated function value. public class FunctionValue { - #region Properties - - /// Gets or sets the value type of a function. - /// The type. public FunctionValueType Type { get; set; } - - /// Gets or sets the value. - /// The value. public object? Value { get; set; } - #endregion - - #region Constants - - /// - /// (Immutable) A defined that represents a true - /// whose value is 1. - /// public static readonly FunctionValue TRUE = new FunctionValue(FunctionValueType.Numeric, 1m); - - /// - /// (Immutable) A defined that represents a false - /// whose value is 0. - /// public static readonly FunctionValue FALSE = new FunctionValue(FunctionValueType.Numeric, 0m); - - /// - /// (Immutable) A defined that represents a undefined value. - /// public static readonly FunctionValue NONE = new FunctionValue(FunctionValueType.None, null); - - /// - /// (Immutable) A defined that represents a numeric value. The - /// default value is 0. - /// public static readonly FunctionValue NUMBER = new FunctionValue(FunctionValueType.Numeric, 0m); - - /// - /// (Immutable) A defined that represents a string value. The default - /// value is . - /// public static readonly FunctionValue STRING = new FunctionValue(FunctionValueType.String, string.Empty); - - /// - /// (Immutable) A defined that represents the number zero. - /// public static readonly FunctionValue ZERO = new FunctionValue(FunctionValueType.Numeric, 0m); - #endregion - - #region Constructors - - /// Default constructor. public FunctionValue() { this.Type = FunctionValueType.None; this.Value = null; } - /// Constructor. - /// The type. - /// The value. public FunctionValue(FunctionValueType type, object? value) { this.Type = type; this.Value = value; - } - - #endregion + } } } diff --git a/src/Core/FunctionValueType.cs b/src/Core/FunctionValueType.cs index f6825d6..5649c92 100644 --- a/src/Core/FunctionValueType.cs +++ b/src/Core/FunctionValueType.cs @@ -6,14 +6,10 @@ using System.Threading.Tasks; namespace CSMic { - /// Values that represent function value types. public enum FunctionValueType { - /// An enum constant representing an undefined or unsupported function value type. None, - /// An enum constant representing a numeric function value type. Numeric, - /// An enum constant representing a string function value type. String } } diff --git a/src/Core/ICodedFunction.cs b/src/Core/ICodedFunction.cs index 4d87726..d81e7d8 100644 --- a/src/Core/ICodedFunction.cs +++ b/src/Core/ICodedFunction.cs @@ -6,32 +6,18 @@ using System.Threading.Tasks; namespace CSMic { - /// - /// Interface for a coded function that can be created at compiletime and invoked at runtime. - /// public interface ICodedFunction { #region Properties - /// Gets the name of the function. - /// The name. string Name { get; } - - /// Gets the expected arguments of the function. - /// The expected arguments. IEnumerable ExpectedArguments { get; } - - /// Gets the return value of the function. - /// The return value. FunctionValue ReturnValue { get; } #endregion #region Methods - /// Executes the function with the given arguments. - /// A variable-length parameters list containing arguments. - /// A FunctionValue representing the result of the function execution. FunctionValue Execute(params FunctionArgument[] args); #endregion diff --git a/src/Core/Variable.cs b/src/Core/Variable.cs index c121ece..5da61c5 100644 --- a/src/Core/Variable.cs +++ b/src/Core/Variable.cs @@ -6,26 +6,20 @@ using System.Threading.Tasks; namespace CSMic { - /// An encapsulated variable that names a runtime value. public class Variable { #region Members - /// The type of the variable. private VariableType type; - /// The name of the variable. private string name; - /// The value assigned to the variable. private object? value; #endregion #region Properties - /// Gets the variable type. - /// The type. public VariableType Type { get @@ -34,8 +28,6 @@ namespace CSMic } } - /// Gets the variable name. - /// The name. public string Name { get @@ -44,8 +36,6 @@ namespace CSMic } } - /// Gets the assigned value. - /// The assigned value. public object? Value { get @@ -58,7 +48,6 @@ namespace CSMic #region Constructor - /// Default constructor. public Variable() { this.type = VariableType.None; @@ -66,10 +55,6 @@ namespace CSMic this.value = null; } - /// Constructor. - /// The type of the variable. - /// The name of the variable. - /// The value assigned to the variable. public Variable(VariableType type, string name, object? value) { this.type = type; diff --git a/src/Core/VariableType.cs b/src/Core/VariableType.cs index bd2e72f..ada5056 100644 --- a/src/Core/VariableType.cs +++ b/src/Core/VariableType.cs @@ -6,16 +6,11 @@ using System.Threading.Tasks; namespace CSMic { - /// Values that represent variable types supported by the parser. public enum VariableType { - /// An enum constant representing an unknown or unsupported type. None, - /// An enum constant representing a numeric type backed by a . Numeric, - /// An enum constant representing numeric array backed by a of . NumericArray, - /// An enum constant representing an expression type backed by a and interpreted by the parser at runtime. Expression, } } diff --git a/src/StandardLibrary/functions/FunctionBase.cs b/src/StandardLibrary/functions/FunctionBase.cs index 5708d7a..eff760f 100644 --- a/src/StandardLibrary/functions/FunctionBase.cs +++ b/src/StandardLibrary/functions/FunctionBase.cs @@ -2,15 +2,10 @@ namespace CSMic.StandardLibrary.Functions { - /// A base class that handles base function handling. public abstract class FunctionBase { - /// Gets the expected arguments. - /// The expected arguments. public virtual IEnumerable ExpectedArguments { get; } - /// Gets the return value. - /// The return value. public virtual FunctionValue ReturnValue { get @@ -20,9 +15,6 @@ namespace CSMic.StandardLibrary.Functions } } - /// Checks the provided arguments to ensure the function contract is honored. - /// A variable-length parameters list containing arguments. - /// True if it succeeds, false if it fails. public bool ArgumentCheck(params FunctionArgument[] args) { // Top level sanity checks. @@ -57,10 +49,6 @@ namespace CSMic.StandardLibrary.Functions return true; } - /// Executes a standard library function. - /// A variable-length parameters list containing arguments. - /// The functions action body. - /// A . public FunctionValue Execute(FunctionArgument[] args, Func action) { if (!ArgumentCheck(args))