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

Scope lost in case line continuation with comment #68

Closed watermarkhu closed 10 months ago

watermarkhu commented 10 months ago

In the case of the scopes meta.function-call.parens.matlab, meta.parens.matlab and meta.method-call.parens.matlab, where there is a line continuation with comment, the scope will be lost after the comment.

For example, in the case of meta.function-call.parens.matlab: image image

This is due to the end pattern negative lookahead does not take into account any character between ... and \n.

https://github.com/mathworks/MATLAB-Language-grammar/blob/96dc679a5e94d966f8920497883ba92e9ae51b62/Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage#L1698