pygments / pygments/pygments

RubyConsoleLexer's prompt pattern is a bit outdated

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

Nobody has claimed this yet.

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

Description

(Original issue 741 created by rossmeissl on 2012-02-29T19:31:08.001285+00:00)

The pattern was last edited by @thatch here: [[https://bitbucket.org/birkenfeld/pygments-main/changeset/6f317b427b60|6f317b427b60]]

Currently we have:

{{{
prompt_re = re.compile('irb([a-zA-Z][a-zA-Z0-9_]):\d{3}:\d+[>"'] '|>> |?> ')
}}}

But newer Ruby IRB sessions look like this:

{{{
$ irb
ruby-1.9.2-p180 :001 > puts "test"
test
=> nil
ruby-1.9.2-p180 :002 >
}}}

This results in essentially non-highlighted IRB sessions.

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 RubyConsoleLexer entry point and its _prompt_re pattern, comparing the existing expression with the newer Ruby IRB session shown in the issue. Update the prompt matching so those sessions are highlighted, then verify the example session is recognized correctly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.