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 indexing_curly_brackets #71

Closed watermarkhu closed 10 months ago

watermarkhu commented 10 months ago

Resolves #70

Also the pattern can be simplified to not include the entire grammar, but only #variables to resolve for nargin, varargin, etc.

watermarkhu commented 10 months ago

I propose to also add the following contentName to the indexing_curly_brackets grammar.

<key>contentName</key>
<string>meta.brackets.matlab</string>

This reflects the contentName of the indexing_by_expression grammar. https://github.com/mathworks/MATLAB-Language-grammar/blob/74c8f75a04d72a8f8acaf26cdfd5bfedd47a53e9/Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage#L1805-L1806

This should have no effect on highlighting, but adding the scope allows for easier debugging.

dklilley commented 10 months ago

Thanks for cleaning this up!

watermarkhu commented 10 months ago

I propose to also add the following contentName to the indexing_curly_brackets grammar.

<key>contentName</key>
<string>meta.brackets.matlab</string>

This reflects the contentName of the indexing_by_expression grammar.

https://github.com/mathworks/MATLAB-Language-grammar/blob/74c8f75a04d72a8f8acaf26cdfd5bfedd47a53e9/Matlab.tmbundle/Syntaxes/MATLAB.tmLanguage#L1805-L1806

This should have no effect on highlighting, but adding the scope allows for easier debugging.

@dklilley what do you think about this proposal?

dklilley commented 10 months ago

This proposal sounds good to me!