mathworks / mathworks/MATLAB-Language-grammar
Tokenization broken in class after nested function call with anonymous function
Nobody has claimed this yet.
- Dominant language
- MATLAB
- Stars
- 64
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
See the following code:
classdef Foo
methods
function test()
foo(bar(@(x) x));
end
end
methods
end
end
In VS Code, this is syntax highlighted in the following way:
The first end is tokenized as keyword.operator.word.matlab instead of storage.type.function.end.matlab.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the tokenization of the provided MATLAB class and nested anonymous-function example in the repository's regular-expression-based grammar. Trace how the first end is matched after the nested call, then verify that it receives storage.type.function.end.matlab rather than keyword.operator.word.matlab.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- matlab
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100