mathworks / mathworks/MATLAB-Language-grammar

Parenthesis not tokenized correctly when there is space preceding it

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

Nobody has claimed this yet.

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

Description

When there is a space before the last parenthesis, it is not identified to be the closing paren of the cellfun() function, shown below.
The top two lines have the parens colored yellow (correct), while the bottom two lines show the red/yellow mismatch (incorrect)

Screenshot 2024-03-05 at 12 26 34 PM (3)

The top two have the token
punctuation.section.group.end.matlab

The bottom two dont have that token, but instead have
string.unquoted.matlab
meta.function-call.command.matlab

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the two parenthesis-highlighting examples from the issue and inspect the grammar rules that tokenize MATLAB function-call punctuation. Compare the tokens for the examples with and without a space before the closing parenthesis; done means both cases produce punctuation.section.group.end.matlab rather than string.unquoted.matlab and meta.function-call.command.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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.