Mercurial > octave
comparison libinterp/parse-tree/pt-eval.cc @ 33449:662938d6b684 bytecode-interpreter
maint: Merge default to bytecode-interpreter
author | Arun Giridhar <arungiridhar@gmail.com> |
---|---|
date | Tue, 23 Apr 2024 15:32:22 -0400 |
parents | 066a27297ba3 5fded8395daa |
children | 1cfa8b20a07d |
comparison
equal
deleted
inserted
replaced
33445:2383f7553930 | 33449:662938d6b684 |
---|---|
5175 print_usage (); | 5175 print_usage (); |
5176 | 5176 |
5177 if (nargin == 3) | 5177 if (nargin == 3) |
5178 { | 5178 { |
5179 octave_idx_type index_position | 5179 octave_idx_type index_position |
5180 = args(1).yidx_type_value ("end: K must be integer value"); | 5180 = args(1).strict_idx_type_value ("end: K must be integer value"); |
5181 | 5181 |
5182 if (index_position < 1) | 5182 if (index_position < 1) |
5183 error ("end: K must be greater than zero"); | 5183 error ("end: K must be greater than zero"); |
5184 | 5184 |
5185 octave_idx_type num_indices | 5185 octave_idx_type num_indices |
5186 = args(2).yidx_type_value ("end: N must be integer value"); | 5186 = args(2).strict_idx_type_value ("end: N must be integer value"); |
5187 | 5187 |
5188 if (num_indices < 1) | 5188 if (num_indices < 1) |
5189 error ("end: N must be greater than zero"); | 5189 error ("end: N must be greater than zero"); |
5190 | 5190 |
5191 return octave_value (args(0).end_index (index_position-1, num_indices)); | 5191 return octave_value (args(0).end_index (index_position-1, num_indices)); |
5716 | 5716 |
5717 dim_vector dims = args(0).dims (); | 5717 dim_vector dims = args(0).dims (); |
5718 if (! dims.all_ones ()) | 5718 if (! dims.all_ones ()) |
5719 error ("inputname: N must be a scalar index"); | 5719 error ("inputname: N must be a scalar index"); |
5720 | 5720 |
5721 int n = args(0).yint_value ("inputname: N must be a scalar index"); | 5721 int n = args(0).strict_int_value ("inputname: N must be a scalar index"); |
5722 | 5722 |
5723 if (n < 1) | 5723 if (n < 1) |
5724 error ("inputname: N must be a scalar index"); | 5724 error ("inputname: N must be a scalar index"); |
5725 | 5725 |
5726 bool ids_only = true; | 5726 bool ids_only = true; |
5727 | 5727 |
5728 if (nargin == 2) | 5728 if (nargin == 2) |
5729 ids_only = args(1).ybool_value ("inputname: IDS_ONLY must be a logical value"); | 5729 ids_only = args(1).strict_bool_value ("inputname: IDS_ONLY must be a logical value"); |
5730 | 5730 |
5731 // Use zero-based indexing internally. | 5731 // Use zero-based indexing internally. |
5732 return ovl (interp.inputname (n-1, ids_only)); | 5732 return ovl (interp.inputname (n-1, ids_only)); |
5733 } | 5733 } |
5734 | 5734 |