MatlabCodeAnalyzer icon indicating copy to clipboard operation
MatlabCodeAnalyzer copied to clipboard

Tokenizer: Parse operators one at a time

Open ChristianStadelmann opened this issue 5 years ago • 4 comments

Prior to this change, any line ending with [punctuation + '...'], for example ||..., would cause the tokenizer to fail.

Fixes #9

ChristianStadelmann avatar Jan 19 '21 22:01 ChristianStadelmann

This is an alternative to #12.

ChristianStadelmann avatar Jan 19 '21 22:01 ChristianStadelmann

I know that you don't like the startsWith, although I don't see a simple alternative here because it operates on a cell array of chars here. Do you know any alternative to a second level loop when using the startsWith?

ChristianStadelmann avatar Jan 19 '21 22:01 ChristianStadelmann

I know that you don't like the startsWith, although I don't see a simple alternative here because it operates on a cell array of chars here. Do you know any alternative to a second level loop when using the startsWith?

Don't get me wrong, I very much endorse startsWith(). But Matlab is kind of crazy to introduce that function just in 2016. ;)

Either way, we could also write a unit test case to cover the documented bug and it's fix. Never done that in Matlab and I suppose only very few cases are only implemented there so far? Therefore, I don' know if that is really required.

I suppose it is on @bastibe to decide if and when #12 or #13 gets accepted?!

HaHeho avatar Jan 20 '21 00:01 HaHeho

I think I generally prefer #12, as I find it a bit easier to follow. However, if you feel #13 is actually a better implementation, I'd go with your suggestions. Honestly, it has been a long while since I last worked with this code, and Matlab in general.

And any improvement of the unit tests would be greatly appreciated, of course!

bastibe avatar Jan 20 '21 19:01 bastibe