Closed chaoqing closed 2 years ago
Welcome to the club of finding fun things with MATLAB.
It is actually correct as is. Please also see https://www.mathworks.com/help/matlab/matlab_prog/command-vs-function-syntax.html
I consider this to be a bug in the MATLAB language :D
Other hilarious features can be found here: https://github.com/florianschanda/miss_hit/blob/master/LEXING_ISSUES.md
Thanks for the explanation, according to the document you mentioned. It seems the lexing result of x ==123
depends on the semantical analysis result of x
. When x
is variable but not function, Matlab should not tigger command syntax.
It seems this is again related to #246 which seems very hard to fix for now, or nearly impossible when just do static analysis without Matlab Runtime.
Right, without semantic analysis there is no error here. Otherwise you'd get one because first you assign to x, then you try to call it.
It's still on the roadmap for me to do semantic analysis, I just am crazy busy with other real life things so things have been a bit slow on MISS_HIT lately.
MISS_HIT Component affected Please choose one from:
Your operating system and Python version
Describe the bug Run
./mh_debug_parser --tree bug.m
with following Matlab scriptIt is clear the parser give incorrect tree for second statement: