Skip to content

Commit

Permalink
Improve bash math expansion lexing
Browse files Browse the repository at this point in the history
  • Loading branch information
rvanvelzen committed Feb 24, 2023
1 parent 8f417de commit 16acd51
Show file tree
Hide file tree
Showing 3 changed files with 680 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pygments/lexers/shell.py
Expand Up @@ -105,10 +105,12 @@ class BashLexer(RegexLexer):
],
'math': [
(r'\)\)', Keyword, '#pop'),
(r'[-+*/%^|&]|\*\*|\|\|', Operator),
(r'\d+#\d+', Number),
(r'\*\*|\|\|<<|>>|[-+*/%^|&<>]', Operator),
(r'\d+#[\da-zA-Z]+', Number),
(r'\d+#(?! )', Number),
(r'0x[\da-zA-Z]+', Number),
(r'\d+', Number),
(r'[a-zA-Z_]\w*', Name.Variable), # user variable
include('root'),
],
'backticks': [
Expand Down
2 changes: 1 addition & 1 deletion tests/examplefiles/singularity/Singularity.output

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 16acd51

Please sign in to comment.