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
50 stars 17 forks source link

Validation function parsing not correct for validation functions with arguments #85

Closed apozharski closed 3 months ago

apozharski commented 3 months ago

When using validation functions which take arguments the parsed tokens are nonsensical. For example:

classdef A
  properties
     n_depth_step_lifting {mustBeInteger, mustBeGreaterThanOrEqual(n_depth_step_lifting, 2)}
  end
end

returns a meta.block.validation.matlab token in the form:

{'token': 'meta.block.validation.matlab',
  'begin': [{'token': 'punctuation.section.block.begin.matlab', 'content': '{'}],
  'end': [{'token': 'punctuation.section.block.end.matlab', 'content': '}'}],
  'children': [{'token': 'variable.other.readwrite.matlab', 'content': 'mustBeInteger'},
                     {'token': 'variable.other.readwrite.matlab',
                         'content': 'n_depth_step_lifting'}]}