summaryrefslogtreecommitdiff
path: root/pygments/lexers/actionscript.py
diff options
context:
space:
mode:
Diffstat (limited to 'pygments/lexers/actionscript.py')
-rw-r--r--pygments/lexers/actionscript.py26
1 files changed, 13 insertions, 13 deletions
diff --git a/pygments/lexers/actionscript.py b/pygments/lexers/actionscript.py
index f0ab6524..28625586 100644
--- a/pygments/lexers/actionscript.py
+++ b/pygments/lexers/actionscript.py
@@ -12,7 +12,7 @@ import re
from pygments.lexer import RegexLexer, bygroups, using, this, words, default
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
- Number, Punctuation
+ Number, Punctuation, Whitespace
__all__ = ['ActionScriptLexer', 'ActionScript3Lexer', 'MxmlLexer']
@@ -33,7 +33,7 @@ class ActionScriptLexer(RegexLexer):
flags = re.DOTALL
tokens = {
'root': [
- (r'\s+', Text),
+ (r'\s+', Whitespace),
(r'//.*?\n', Comment.Single),
(r'/\*.*?\*/', Comment.Multiline),
(r'/(\\\\|\\[^\\]|[^/\\\n])*/[gim]*', String.Regex),
@@ -134,18 +134,18 @@ class ActionScript3Lexer(RegexLexer):
flags = re.DOTALL | re.MULTILINE
tokens = {
'root': [
- (r'\s+', Text),
+ (r'\s+', Whitespace),
(r'(function\s+)(' + identifier + r')(\s*)(\()',
bygroups(Keyword.Declaration, Name.Function, Text, Operator),
'funcparams'),
(r'(var|const)(\s+)(' + identifier + r')(\s*)(:)(\s*)(' +
typeidentifier + r')',
- bygroups(Keyword.Declaration, Text, Name, Text, Punctuation, Text,
+ bygroups(Keyword.Declaration, Whitespace, Name, Whitespace, Punctuation, Whitespace,
Keyword.Type)),
(r'(import|package)(\s+)((?:' + identifier + r'|\.)+)(\s*)',
- bygroups(Keyword, Text, Name.Namespace, Text)),
+ bygroups(Keyword, Whitespace, Name.Namespace, Whitespace)),
(r'(new)(\s+)(' + typeidentifier + r')(\s*)(\()',
- bygroups(Keyword, Text, Keyword.Type, Text, Operator)),
+ bygroups(Keyword, Whitespace, Keyword.Type, Whitespace, Operator)),
(r'//.*?\n', Comment.Single),
(r'/\*.*?\*/', Comment.Multiline),
(r'/(\\\\|\\[^\\]|[^\\\n])*/[gisx]*', String.Regex),
@@ -173,22 +173,22 @@ class ActionScript3Lexer(RegexLexer):
(r'[~^*!%&<>|+=:;,/?\\{}\[\]().-]+', Operator),
],
'funcparams': [
- (r'\s+', Text),
+ (r'\s+', Whitespace),
(r'(\s*)(\.\.\.)?(' + identifier + r')(\s*)(:)(\s*)(' +
typeidentifier + r'|\*)(\s*)',
- bygroups(Text, Punctuation, Name, Text, Operator, Text,
- Keyword.Type, Text), 'defval'),
+ bygroups(Whitespace, Punctuation, Name, Whitespace, Operator, Whitespace,
+ Keyword.Type, Whitespace), 'defval'),
(r'\)', Operator, 'type')
],
'type': [
(r'(\s*)(:)(\s*)(' + typeidentifier + r'|\*)',
- bygroups(Text, Operator, Text, Keyword.Type), '#pop:2'),
+ bygroups(Whitespace, Operator, Whitespace, Keyword.Type), '#pop:2'),
(r'\s+', Text, '#pop:2'),
default('#pop:2')
],
'defval': [
(r'(=)(\s*)([^(),]+)(\s*)(,?)',
- bygroups(Operator, Text, using(this), Text, Operator), '#pop'),
+ bygroups(Operator, Whitespace, using(this), Whitespace, Operator), '#pop'),
(r',', Operator, '#pop'),
default('#pop')
]
@@ -231,12 +231,12 @@ class MxmlLexer(RegexLexer):
('-', Comment),
],
'tag': [
- (r'\s+', Text),
+ (r'\s+', Whitespace),
(r'[\w.:-]+\s*=', Name.Attribute, 'attr'),
(r'/?\s*>', Name.Tag, '#pop'),
],
'attr': [
- (r'\s+', Text),
+ (r'\s+', Whitespace),
('".*?"', String, '#pop'),
("'.*?'", String, '#pop'),
(r'[^\s>]+', String, '#pop'),