Implement the FieldMap struct and its associated function reorder, which is responsible for reordering a vector of CallArg<UntypedExpr> based on specified field mappings.
Requirements:
Struct Definition: Define the FieldMap struct with the following properties:
arity: usize: This represents the number of arguments that can be processed.
fields: HashMap<String, usize>: This maps field names to their respective positions.
Functionality: Implement the reorder method for the FieldMap struct. The method should:
Accept a mutable reference to a vector of CallArg<UntypedExpr>, referred to as args, and a reference to a SrcSpan for location context.
Reorder the args vector such that all arguments that are not labeled (i.e., label: None) appear first, followed by labeled arguments ordered by their corresponding index as specified in the fields HashMap.
Ensure that the number of arguments in args does not exceed the arity.
Handle cases where some arguments may be labeled but do not exist in fields (these should maintain their original position).
Return Value: The reorder method should return a Result<(), Error>. It should return Ok(()) if the reordering is successful, and an Error if the args length exceeds arity.
Location:
Place your implementation in the /app/ directory of the project.
Ensure that your implementation passes all provided tests in the existing test suite.