watermarkhu / textmate-grammar-python

Python lexer and tokenizer based on textmate grammars
https://textmate-grammar-python.readthedocs.io
MIT License
11 stars 2 forks source link

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

Closed apozharski closed 4 months ago

apozharski commented 4 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'}]}

I am not sure if this is an underlying issue in MATLAB-Language-grammar, and if it is I am happy to close this and open the issue there.

apozharski commented 4 months ago

Opened issue: https://github.com/mathworks/MATLAB-Language-grammar/issues/85 against MATLAB-Language-grammar, as well as a PR which I believe addresses it: https://github.com/mathworks/MATLAB-Language-grammar/pull/86

Closing this.