zdharma-continuum / fast-syntax-highlighting

Feature-rich syntax highlighting for ZSH
BSD 3-Clause "New" or "Revised" License
1.06k stars 76 forks source link

_chroma/-perl.ch: Support -E flag #61

Open mrnoname1000 opened 7 months ago

mrnoname1000 commented 7 months ago

Description

Perl supports providing a command with -e or -E. The latter enables all optional features and it's nice for concise one-liners, but F-Sy-H doesn't recognize it. This PR adds a check for the -E flag and highlights it the same way as -e

Motivation and Context

It adds syntax highlighting for perl -E 'script' style invocation.

Usage examples

-E enables the isa operator. This would result in a syntax error with -e.

perl -E '$a isa $b'

How Has This Been Tested?

Types of changes

Checklist:

It looks like no existing tests cover this scenario but I ran them anyway. I updated the comment at the top to reflect the changes.