pygments / pygments/pygments

NASM lexer: Macros with whitespace before it are not recognized

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

Nobody has claimed this yet.

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

Description

(Original issue 1021 created by jonasc on 2014-08-08T15:28:49.395988+00:00)

Hi,

as you can see in the following demo, macros not starting at the beginning of the line are not recognized by the NASMLexer and instead issue error tokens: http://pygments.org/demo/531755/

I've attached a little change (swapping whitespace and macro rules) which fixes this.

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 with the NASMLexer and reproduce the whitespace-before-macro case using the linked Pygments demo. Review the lexer’s whitespace and macro rules, then verify that indented macros are recognized instead of producing error tokens.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.