Skip to content

Commit b2aa7bd

Browse files
committed
Enhance documentation in CommonTypes.fs
Added detailed comments for types and members, including Accessor and Selection, to improve code clarity and suggest more accurate naming. Clarified the purpose of fields in the Selection type.
1 parent af4abc6 commit b2aa7bd

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

CommonTypes/CommonTypes.fs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,15 @@ type UserErrorSeverity =
1818
| WARNING
1919
| INFO
2020

21+
/// Represents the kind of target (value, pointer, or array element) accessed during encoding/decoding.
22+
/// A more accurate name might be AccessTargetType.
2123
type SelectionType =
2224
| Value
2325
| Pointer
2426
| FixArray
2527

28+
/// Represents a node in the access path from the function parameter to the current type.
29+
/// A more accurate name might be AccessStep.
2630
type Accessor =
2731
| ValueAccess of string * SelectionType * bool // selection identifier and its type
2832
| PointerAccess of string * SelectionType * bool // selection identifier and its type
@@ -38,10 +42,12 @@ type Accessor =
3842
| PointerAccess _ -> Pointer
3943
| ArrayAccess _ -> FixArray
4044

45+
/// Represents a path of accesses (fields, pointers, array elements) starting from a root object towards a nested element.
46+
/// A more accurate name might be AccessPath.
4147
type Selection = {
42-
receiverId: string
43-
receiverType: SelectionType
44-
path: Accessor list
48+
receiverId: string // The name of the function parameter that holds the root ASN.1 type being processed (e.g., val, pVal, pVal1).
49+
receiverType: SelectionType // the access type of the function parameter
50+
path: Accessor list // in long fields, this is the path to the field
4551
} with
4652
static member emptyPath (receiverId: string) (receiverType: SelectionType): Selection =
4753
{ Selection.receiverId = receiverId; receiverType = receiverType; path = []}

0 commit comments

Comments
 (0)