summaryrefslogtreecommitdiff
path: root/pygments/lexers/shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/shell.py')
-rw-r--r--pygments/lexers/shell.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/pygments/lexers/shell.py b/pygments/lexers/shell.py
index b069b375..df9b56f4 100644
--- a/pygments/lexers/shell.py
+++ b/pygments/lexers/shell.py
@@ -71,15 +71,15 @@ class BashLexer(RegexLexer):
(r'&', Punctuation),
(r'\|', Punctuation),
(r'\s+', Text),
- (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text),
(r'\d+(?= |\Z)', Number),
+ (r'[^=\s\[\]{}()$"\'`\\<&|;]+', Text),
(r'\$#?(\w+|.)', Name.Variable),
(r'<', Text),
],
'curly': [
(r'}', Keyword, '#pop'),
(r':-', Keyword),
- (r'[a-zA-Z0-9_]+', Name.Variable),
+ (r'\w+', Name.Variable),
(r'[^}:"\'`$]+', Punctuation),
(r':', Punctuation),
include('root'),
@@ -91,6 +91,8 @@ class BashLexer(RegexLexer):
'math': [
(r'\)\)', Keyword, '#pop'),
(r'[-+*/%^|&]|\*\*|\|\|', Operator),
+ (r'\d+#\d+', Number),
+ (r'\d+#(?! )', Number),
(r'\d+', Number),
include('root'),
],
@@ -294,24 +296,25 @@ class TcshLexer(RegexLexer):
r'umask|unalias|uncomplete|unhash|universe|unlimit|unset|unsetenv|'
r'ver|wait|warp|watchlog|where|which)\s*\b',
Name.Builtin),
- (r'#.*\n', Comment),
+ (r'#.*', Comment),
(r'\\[\w\W]', String.Escape),
(r'(\b\w+)(\s*)(=)', bygroups(Name.Variable, Text, Operator)),
(r'[\[\]{}()=]+', Operator),
(r'<<\s*(\'?)\\?(\w+)[\w\W]+?\2', String),
+ (r';', Punctuation),
],
'data': [
(r'(?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"', String.Double),
(r"(?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*'", String.Single),
(r'\s+', Text),
- (r'[^=\s\[\]{}()$"\'`\\]+', Text),
+ (r'[^=\s\[\]{}()$"\'`\\;#]+', Text),
(r'\d+(?= |\Z)', Number),
(r'\$#?(\w+|.)', Name.Variable),
],
'curly': [
(r'}', Keyword, '#pop'),
(r':-', Keyword),
- (r'[a-zA-Z0-9_]+', Name.Variable),
+ (r'\w+', Name.Variable),
(r'[^}:"\'`$]+', Punctuation),
(r':', Punctuation),
include('root'),
@@ -387,13 +390,13 @@ class PowerShellLexer(RegexLexer):
(r'`[\'"$@-]', Punctuation),
(r'"', String.Double, 'string'),
(r"'([^']|'')*'", String.Single),
- (r'(\$|@@|@)((global|script|private|env):)?[a-z0-9_]+',
+ (r'(\$|@@|@)((global|script|private|env):)?\w+',
Name.Variable),
(r'(%s)\b' % '|'.join(keywords), Keyword),
(r'-(%s)\b' % '|'.join(operators), Operator),
- (r'(%s)-[a-z_][a-z0-9_]*\b' % '|'.join(verbs), Name.Builtin),
- (r'\[[a-z_\[][a-z0-9_. `,\[\]]*\]', Name.Constant), # .net [type]s
- (r'-[a-z_][a-z0-9_]*', Name),
+ (r'(%s)-[a-z_]\w*\b' % '|'.join(verbs), Name.Builtin),
+ (r'\[[a-z_\[][\w. `,\[\]]*\]', Name.Constant), # .net [type]s
+ (r'-[a-z_]\w*', Name),
(r'\w+', Name),
(r'[.,;@{}\[\]$()=+*/\\&%!~?^`|<>-]|::', Punctuation),
],