octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62639] inputParser fails to recognize Optiona


From: Rik
Subject: [Octave-bug-tracker] [bug #62639] inputParser fails to recognize Optional parameter with argument
Date: Tue, 5 Jul 2022 14:19:02 -0400 (EDT)

Update of bug #62639 (project octave):

                 Summary: inputParser fails to add Optional argument with
empty cell default value => inputParser fails to recognize Optional parameter
with argument

    _______________________________________________________

Follow-up Comment #10:

I think this is a new problem, but let's continue with this bug report.

The code doesn't seem to recognize that the first argument is an optional
parameter and that it should be proceed down that path of setting the optional
parameter.  For reference, this code works


p = inputParser;
p.addParameter('opt',{});
p.parse('opt', 'xxx')


while this code fails


p = inputParser;
p.addOptional('opt',{});
p.parse('opt', 'xxx')
error: argument 'XXX' is not a valid parameter


The code for this starts at line 381 in scripts/miscellaneous/inputParser.m at
"function parse".  I took a brief look, but I found the code difficult to
understand.  There *is* a search for Optional parameters according to the
comment at line 418.


      ## Search for a list of Optional arguments






    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62639>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]