mathworks / MATLAB-Language-grammar

This repository contains a regular expression based language grammar for MATLAB to be used by GitHub Linguist for highlighting MATLAB code on GitHub
49 stars 17 forks source link

simplify read/write operation regex #61

Closed watermarkhu closed 10 months ago

watermarkhu commented 1 year ago

The removed lines were probably copied from https://github.com/mathworks/MATLAB-Language-grammar/blob/4f1c0c8e8eac1494ee9c2bac18605aca08b08806/Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage#L2866

The negative lookahead on [a-zA-Z0-9_] does nothing due to the [a-zA-Z0-9_]* just before.

dklilley commented 1 year ago

Trying this out on regex101, it appears that there is a difference in behavior. The original property regex matches asd in foo.asd, but does not match it in foo.asd(. However, the new regex matches as in foo.asd(.

Can you confirm?

watermarkhu commented 11 months ago

This seems indeed to be the case. I'll add a test to this PR instead.

dklilley commented 10 months ago

Hi Mark, sorry for the delay in getting back to this. What is the current status of this PR? It looks like the only change right now is to a test file.

watermarkhu commented 10 months ago

Hi Duncan, The original edit was invalid. But there also wasn't a test to check for the behavior as you indicated. So the edit is disregarded but a test has been added.

dklilley commented 10 months ago

Makes sense, thank you!