summaryrefslogtreecommitdiff
path: root/pygments/lexers/sas.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/sas.py')
-rw-r--r--pygments/lexers/sas.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pygments/lexers/sas.py b/pygments/lexers/sas.py
index c91ea319..3747ed9a 100644
--- a/pygments/lexers/sas.py
+++ b/pygments/lexers/sas.py
@@ -5,7 +5,7 @@
Lexer for SAS.
- :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
+ :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -16,6 +16,7 @@ from pygments.token import Comment, Keyword, Name, Number, String, Text, \
__all__ = ['SASLexer']
+
class SASLexer(RegexLexer):
"""
For `SAS <http://www.sas.com/>`_ files.
@@ -136,7 +137,7 @@ class SASLexer(RegexLexer):
],
# Special highlight for proc, data, quit, run
'proc-data': [
- (r'(^|;)\s*(proc [a-zA-Z0-9_]+|data|run|quit)[\s;\n]',
+ (r'(^|;)\s*(proc \w+|data|run|quit)[\s;]',
Keyword.Reserved),
],
# Special highlight cards and datalines
@@ -154,7 +155,6 @@ class SASLexer(RegexLexer):
(r'NOTE(:|-).*', Generic, '#pop'),
(r'WARNING(:|-).*', Generic.Emph, '#pop'),
(r'ERROR(:|-).*', Generic.Error, '#pop'),
- (r'(?!(WARNING|NOTE|ERROR))+', Text, '#pop'),
include('general'),
],
'general': [
@@ -188,8 +188,8 @@ class SASLexer(RegexLexer):
],
# Strings and user-defined variables and macros (order matters)
'vars-strings': [
- (r'&[a-zA-Z_][a-zA-Z0-9_]{0,31}\.?', Name.Variable),
- (r'%[a-zA-Z_][a-zA-Z0-9_]{0,31}', Name.Function),
+ (r'&[a-z_]\w{0,31}\.?', Name.Variable),
+ (r'%[a-z_]\w{0,31}', Name.Function),
(r'\'', String, 'string_squote'),
(r'"', String, 'string_dquote'),
],
@@ -209,11 +209,11 @@ class SASLexer(RegexLexer):
(r'[$"\\]', String),
],
'validvar': [
- (r'[a-zA-Z_][a-zA-Z0-9_]{0,31}\.?', Name.Variable, '#pop'),
+ (r'[a-z_]\w{0,31}\.?', Name.Variable, '#pop'),
],
# SAS numbers and special variables
'numbers': [
- (r'\b[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[i]?\b',
+ (r'\b[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)(E[+-]?[0-9]+)?i?\b',
Number),
],
'special': [