From 8c0c16ed878976415a0f59933725bf7fdaa4b34e Mon Sep 17 00:00:00 2001 From: Will Hawkins Date: Mon, 27 Apr 2026 09:03:59 -0400 Subject: [PATCH] documentation: Update Note Protocol Using /// rather than simply //. Signed-off-by: Will Hawkins --- README.md | 2 +- Sources/Common/DataTypes.swift | 12 ++++++------ Sources/Common/P4Types.swift | 2 +- Sources/P4Compiler/Declarations.swift | 4 ++-- Sources/P4Compiler/Expression.swift | 2 +- Sources/P4Compiler/Parser.swift | 2 +- Sources/P4Lang/Declarations.swift | 2 +- Sources/P4Lang/Expressions.swift | 2 +- Sources/P4Runtime/Expressions.swift | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 9596b25..c058443 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ While coding, it may be useful to leave ourselves notes. Every note is formatted ```Swift -// NOTE: note text +/// NOTE<: optional note text> ``` where `NOTE` can be: diff --git a/Sources/Common/DataTypes.swift b/Sources/Common/DataTypes.swift index 7df2722..50889fb 100644 --- a/Sources/Common/DataTypes.swift +++ b/Sources/Common/DataTypes.swift @@ -611,7 +611,7 @@ public class P4ArrayValue: P4DataValue { } public func set(index: Int, to: P4Value) -> Result { - // TODO: Check for OOB + /// TODO: Check for OOB var updated_values = self.value updated_values[index] = to return Result.Ok(P4ArrayValue(withType: self.vtype, withValue: updated_values)) @@ -621,7 +621,7 @@ public class P4ArrayValue: P4DataValue { guard rhs as? P4ArrayValue != nil else { return false } - // TODO!! + /// TODO return true } @@ -629,7 +629,7 @@ public class P4ArrayValue: P4DataValue { guard rhs as? P4ArrayValue != nil else { return false } - // TODO!! + /// TODO return true } @@ -637,7 +637,7 @@ public class P4ArrayValue: P4DataValue { guard rhs as? P4ArrayValue != nil else { return false } - // TODO!! + /// TODO return true } @@ -645,7 +645,7 @@ public class P4ArrayValue: P4DataValue { guard rhs as? P4ArrayValue != nil else { return false } - // TODO!! + /// TODO return true } @@ -653,7 +653,7 @@ public class P4ArrayValue: P4DataValue { guard rhs as? P4ArrayValue != nil else { return false } - // TODO!! + /// TODO return true } diff --git a/Sources/Common/P4Types.swift b/Sources/Common/P4Types.swift index fcf3afa..9c7dc82 100644 --- a/Sources/Common/P4Types.swift +++ b/Sources/Common/P4Types.swift @@ -204,7 +204,7 @@ public struct P4Value: CustomStringConvertible { } public func update(withNewValue value: P4DataValue) -> Result { - // TODO: Check that the types match. + /// TODO: Check that the types match. return .Ok(P4Value(value, self._type)) } diff --git a/Sources/P4Compiler/Declarations.swift b/Sources/P4Compiler/Declarations.swift index 2d04e20..018cab9 100644 --- a/Sources/P4Compiler/Declarations.swift +++ b/Sources/P4Compiler/Declarations.swift @@ -30,7 +30,7 @@ extension Declaration: CompilableDeclaration { let declaration_compilers: [String: CompilableDeclaration.Type] = [ "function_declaration": FunctionDeclaration.self, "control_declaration": Control.self, - "type_declaration": P4Struct.self, // ASSUME: Type declarations are struct declarations. + "type_declaration": P4Struct.self, /// ASSUME: Type declarations are struct declarations. "extern_declaration": ExternDeclaration.self, ] @@ -273,7 +273,7 @@ extension P4Lang.Parser: CompilableDeclaration { let type_node = current_node var parser_name: Common.Identifier? = .none - // TODO: Handle parser parameter lists. + /// TODO: Handle parser parameter lists. var parameter_list = ParameterList() do { diff --git a/Sources/P4Compiler/Expression.swift b/Sources/P4Compiler/Expression.swift index 63e73df..c0160f5 100644 --- a/Sources/P4Compiler/Expression.swift +++ b/Sources/P4Compiler/Expression.swift @@ -352,7 +352,7 @@ extension BinaryOperatorExpression: CompilableExpression { ErrorOnNode( node: node, withError: "Malformed binary operator expression"))) - // TODO: This macro cannot handle new lines in the arrays + /// TODO: This macro cannot handle new lines in the arrays // swift-format-ignore #RequireNodesType( nodes: binary_operator_expression_node, diff --git a/Sources/P4Compiler/Parser.swift b/Sources/P4Compiler/Parser.swift index fda4bd1..f62e187 100644 --- a/Sources/P4Compiler/Parser.swift +++ b/Sources/P4Compiler/Parser.swift @@ -275,7 +275,7 @@ public struct Parser { var error: Error? = .none var current_context = context - // TODO: Assert that there is only one. + /// TODO: Assert that there is only one. node.enumerateNamedChildren { parser_state in if parser_state.nodeType != "parserState" { return diff --git a/Sources/P4Lang/Declarations.swift b/Sources/P4Lang/Declarations.swift index a5b3cd3..ef01350 100644 --- a/Sources/P4Lang/Declarations.swift +++ b/Sources/P4Lang/Declarations.swift @@ -44,7 +44,7 @@ public struct Declaration: P4DataType { } public func def() -> any Common.P4DataValue { - // TODO: Is a default of the extern'd type the right way to go? + /// TODO: Is a default of the extern'd type the right way to go? return self.identifier.type.dataType().def() } diff --git a/Sources/P4Lang/Expressions.swift b/Sources/P4Lang/Expressions.swift index 90eaf37..6029037 100644 --- a/Sources/P4Lang/Expressions.swift +++ b/Sources/P4Lang/Expressions.swift @@ -141,7 +141,7 @@ public struct FunctionCall { public init(_ callee: P4FFI, withArguments arguments: ArgumentList) { self.callee = (.none, callee) self.arguments = arguments - // ASSUME: That the FFI has been checked and the type is always a function declaration. + /// ASSUME: That the FFI has been checked and the type is always a function declaration. self.return_type = (callee.type().dataType() as! FunctionDeclaration).tipe.dataType() } } diff --git a/Sources/P4Runtime/Expressions.swift b/Sources/P4Runtime/Expressions.swift index 7d517ce..f899729 100644 --- a/Sources/P4Runtime/Expressions.swift +++ b/Sources/P4Runtime/Expressions.swift @@ -367,7 +367,7 @@ extension FieldAccessExpression: EvaluatableExpression { return (.Error(Error(withMessage: "\(strct) does not identify a struct")), updated_execution) } - // TODO: Create a default value? + /// TODO: Create a default value? guard let value = struct_strct.get(field: self.field) else { return (.Error(Error(withMessage: "Missing value")), updated_execution) }