Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Tokenization broken in class after nested function call with anonymous function

Open
#96 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
matlab
Domain
tooling

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.

Description

bug

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:

Image

The first end is tokenized as keyword.operator.word.matlab instead of storage.type.function.end.matlab.

Dominant language
MATLAB
Stars
64
Forks
22
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mathworks/MATLAB-Language-grammar

All issues in mathworks/MATLAB-Language-grammar

Similar issues

More MATLAB issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.