mathworks / mathworks/MATLAB-Language-grammar

Escape characters are highlighted in character arrays

Open
#75 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
When initializing a raw string variable, escape characters (backslash + char) get highlighted by default. This occurs for character arrays (using single quotes), but not for strings (using double quotes).

For example, when defining a Windows path:
temp_path = '\\somedrive\path\to\right\folder\';
In this case, the escape characters \\, \r, \t, and \f characters would be highlighted.

If you do the same but with double quotations, the error does not occur. This is the expected behavior.

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

The repository contains a regular-expression-based MATLAB grammar used by GitHub Linguist; start by locating the character-array escape-highlighting rule and compare it with the double-quoted string behavior. Reproduce the Windows-path example, then verify that escapes in single-quoted character arrays are no longer highlighted while string highlighting remains unchanged.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.