pygments / pygments/pygments

Objective-C lexer cannot identify message without parameters

Open
#820 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

S-major T-bug X-imported
Dominant language
Python
Stars
2.2k
Forks
885
PR merge metrics
No merged PRs in 30d

Description

(Original issue 1113 created by renfeisong on 2015-05-28T05:20:12.611862+00:00)

For example,

#!objective-c

[[NSCoreService serviceCenter] registerSubscriber:self];

The lexer will recognize registerSubscriber: as a method label (because there is a parameter follows it), but it will ignore serviceCenter (interpreted as Token.Name which is the same as the receiver NSCoreService).

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

Reproduce the reported snippet through Pygments' Objective-C lexer and inspect how it tokenizes the receiver and message selectors. Trace the lexer rules handling selectors with and without parameters, then add or update a regression test for this example. Done means serviceCenter is distinguished from the receiver and the complete message is tokenized consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
objective-c, python
Domain
devtools
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.