Add location indicator underneath mpath expression for errors #7

Open
opened 2025-10-11 03:43:35 +00:00 by UserCurt · 0 comments
UserCurt commented 2025-10-11 03:43:35 +00:00 (Migrated from codeberg.org)

When errors arise, it can be helpful to show the user which part of the mpath is causing the error. This can be indicated by displaying the mpath expression and underneath pointing to the problematic part. For example:

>> S = struct(A={1, 2}, B={3, 4});
>> mpath.resolve(S,"/A<3>", NullField="error")
Error using mpath.Pointer.handleAtomicBranching (line 58)
Indices 3 exceed number of outputs (2)
/A<3>
  ^^^

Implementation of this already has started for parsing. This feature request is to expand this to other errors.

When errors arise, it can be helpful to show the user which part of the mpath is causing the error. This can be indicated by displaying the mpath expression and underneath pointing to the problematic part. For example: ``` >> S = struct(A={1, 2}, B={3, 4}); >> mpath.resolve(S,"/A<3>", NullField="error") Error using mpath.Pointer.handleAtomicBranching (line 58) Indices 3 exceed number of outputs (2) /A<3> ^^^ ``` Implementation of this already has started for parsing. This feature request is to expand this to other errors.
Sign in to join this conversation.
No description provided.