pygments / pygments/pygments

Bash heredoc for input, redirected output

Open
#326 2 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 619 created by dtrebbien on 2010-12-04T17:58:13.580644+00:00)

When a heredoc is used to feed data to a command, and the standard output of the command is redirected to a file, Pygments does not highlight the "redirect output to a file" part like normal.

For example: http://pygments.org/demo/11929/

{{{
cat <in.txt >out.txt
cat <<'EOF' >nano/hooks/pre-revprop-change
#! /usr/bin/env sh
exit 0
EOF
}}}

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 Bash example from the issue in Pygments and inspect the Bash lexer entry point responsible for heredocs and redirections. Confirm the current highlighted output, then add coverage for the shown command; done means heredoc input and redirected output are highlighted consistently with ordinary redirections.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.