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

Fix broken attribute parsing in classdef. #88

Closed apozharski closed 1 month ago

apozharski commented 1 month ago

Resolves #87

This still is not entirely correct however it fails only in the case where the end of the attribute block is separated by newline (and line continuation) from the ClassName. Making a fully correct TextMate compatible grammar seems impossible due to the ability to arbitrarily place line continuations, however this is a closer approximation and improves the usability of this grammar for further machine interaction e.g. https://github.com/sphinx-contrib/matlabdomain

Note: #86 must go in first.

apozharski commented 1 month ago

Latest push also supports proper parsing of metaclasses on the right hand side of the assignments e.g. InferiorClasses = ?foo.bar.baz

This is currently only supported in attributes however I have opened #89 to generalize this to the top level.

dklilley commented 1 month ago

Thanks for making these changes!