jamesjuett / MatCrab

A program visualization tool for Matlab
GNU Lesser General Public License v3.0
0 stars 0 forks source link

`:` can be used in function calls. Should only be permitted in indexing expressions. #11

Open jamesjuett opened 5 years ago

jamesjuett commented 5 years ago

It appears the issue is that ColonExpression's evaluate function returns a success result with a dummy matrix. Possible fix would be to have it return an error result, then make sure indexing expressions don't try to evaluate indices that are colons. Then anything that does try to evaluate a colon runs into an error.

jamesjuett commented 5 years ago

example of problem sum(:, :) in MatCrab yields [1]. sum(:, :) in MATLAB yields a particularly unhelpful error message of "Undefined function or variable 'sum'."