rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.32k stars 731 forks source link

The MATLAB lexer produces many false positives due to the builtin name handling #1816

Open KaesetorteGithub opened 2 years ago

KaesetorteGithub commented 2 years ago

Name of the lexer MATLAB

Additional context When using the MATLAB lexer, all builtin names are treated as keywords. This does not represent the "expected" hightlighting standards from working in the MATLAB editor and makes looking at code highlighted by this lexer confusing.

Due to the large ammount of builtins in MATLAB and their sometimes very generic names like "result" or "stack" and the fact that MATLAB does not reserve these words, there are also a lot of false positives where e.g. a variablename can get hightlighted when it shouldnt be.

I would suggest either a way to disable the highlighting of builtins to match the behaviour of the MATLAB editor more closely, or a MATLAB-lite lexer which does not include the builtins.