summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/teal.py9
-rw-r--r--tests/examplefiles/teal/example.teal.output20
-rw-r--r--tests/snippets/teal/test_comments.txt4
-rw-r--r--tests/snippets/teal/test_literals.txt8
-rw-r--r--tests/snippets/teal/test_strings.txt2
5 files changed, 22 insertions, 21 deletions
diff --git a/pygments/lexers/teal.py b/pygments/lexers/teal.py
index b49bb4b8..dfe6ca78 100644
--- a/pygments/lexers/teal.py
+++ b/pygments/lexers/teal.py
@@ -9,7 +9,8 @@
"""
from pygments.lexer import RegexLexer, bygroups, include, words
-from pygments.token import Comment, Name, Number, String, Text, Keyword
+from pygments.token import Comment, Name, Number, String, Text, Keyword, \
+ Whitespace
__all__ = ['TealLexer']
@@ -49,7 +50,7 @@ class TealLexer(RegexLexer):
'AssetTotal', 'AssetDecimals', 'AssetDefaultFrozen', 'AssetUnitName',
'AssetName', 'AssetURL', 'AssetMetadataHash', 'AssetManager',
'AssetReserve', 'AssetFreeze', 'AssetClawback',
- }, suffix = r'\b')
+ }, suffix=r'\b')
identifier = r'[^ \t\n]+(?=\/\/)|[^ \t\n]+'
newline = r'\r?\n'
@@ -69,7 +70,7 @@ class TealLexer(RegexLexer):
(r'"', String, 'string'),
(r'(b(?:ase)?(?:32|64) ?)(\(?[a-zA-Z0-9+/=]+\)?)',
bygroups(String.Affix, String.Other)),
- (r'[A-Z2-7]{58}', Number), # address
+ (r'[A-Z2-7]{58}', Number), # address
(r'0x[\da-fA-F]+', Number.Hex),
(r'\d+', Number.Integer),
(keywords, Keyword),
@@ -82,7 +83,7 @@ class TealLexer(RegexLexer):
(r'"', String, '#pop'),
],
'whitespace': [
- (r'[ \t]+', Text),
+ (r'[ \t]+', Whitespace),
(r'//[^\n]+', Comment.Single),
],
}
diff --git a/tests/examplefiles/teal/example.teal.output b/tests/examplefiles/teal/example.teal.output
index 20b267d0..9de9781b 100644
--- a/tests/examplefiles/teal/example.teal.output
+++ b/tests/examplefiles/teal/example.teal.output
@@ -8,12 +8,12 @@
'\n' Text.Whitespace
'txn' Name.Function
-' ' Text
+' ' Text.Whitespace
'Fee' Keyword
'\n' Text
'int' Name.Function
-' ' Text
+' ' Text.Whitespace
'10000' Literal.Number.Integer
'\n' Text
@@ -26,16 +26,16 @@
'\n' Text.Whitespace
'arg' Name.Function
-' ' Text
+' ' Text.Whitespace
'0' Literal.Number.Integer
'\n' Text
'len' Name.Function
-' ' Text
+' ' Text.Whitespace
'\n' Text
'int' Name.Function
-' ' Text
+' ' Text.Whitespace
'73' Literal.Number.Integer
'\n' Text
@@ -51,7 +51,7 @@
'\n' Text.Whitespace
'arg' Name.Function
-' ' Text
+' ' Text.Whitespace
'0' Literal.Number.Integer
'\n' Text
@@ -59,7 +59,7 @@
'\n' Text
'byte' Name.Function
-' ' Text
+' ' Text.Whitespace
'base64 ' Literal.String.Affix
'30AT2gOReDBdJmLBO/DgvjC6hIXgACecTpFDcP1bJHU=' Literal.String.Other
'\n' Text
@@ -76,14 +76,14 @@
'\n' Text.Whitespace
'txn' Name.Function
-' ' Text
+' ' Text.Whitespace
'CloseRemainderTo' Keyword
'\n' Text
'txn' Name.Function
-' ' Text
+' ' Text.Whitespace
'Receiver' Keyword
-' ' Text
+' ' Text.Whitespace
'\n' Text
'==' Name.Function
diff --git a/tests/snippets/teal/test_comments.txt b/tests/snippets/teal/test_comments.txt
index 28675689..df7e1b18 100644
--- a/tests/snippets/teal/test_comments.txt
+++ b/tests/snippets/teal/test_comments.txt
@@ -10,7 +10,7 @@ label: implicit comment
'//c1' Comment.Single
'\n' Text
-' ' Text
+' ' Text.Whitespace
'//c2' Comment.Single
'\n' Text.Whitespace
@@ -19,7 +19,7 @@ label: implicit comment
'\n' Text
'a' Name.Function
-' ' Text
+' ' Text.Whitespace
'// c4' Comment.Single
'\n' Text
diff --git a/tests/snippets/teal/test_literals.txt b/tests/snippets/teal/test_literals.txt
index eb0e8cb7..46e43dc1 100644
--- a/tests/snippets/teal/test_literals.txt
+++ b/tests/snippets/teal/test_literals.txt
@@ -6,23 +6,23 @@ a b64 aB/c23=
---tokens---
'a' Name.Function
-' ' Text
+' ' Text.Whitespace
'0x1AaAF' Literal.Number.Hex
'\n' Text
'a' Name.Function
-' ' Text
+' ' Text.Whitespace
'7777777777777777777777777777777777777777777777777774MSJUVU' Literal.Number
'\n' Text
'a' Name.Function
-' ' Text
+' ' Text.Whitespace
'base32' Literal.String.Affix
'(aB/c23=)' Literal.String.Other
'\n' Text
'a' Name.Function
-' ' Text
+' ' Text.Whitespace
'b64 ' Literal.String.Affix
'aB/c23=' Literal.String.Other
'\n' Text
diff --git a/tests/snippets/teal/test_strings.txt b/tests/snippets/teal/test_strings.txt
index 59d8d6c4..4e32633c 100644
--- a/tests/snippets/teal/test_strings.txt
+++ b/tests/snippets/teal/test_strings.txt
@@ -3,7 +3,7 @@ a "abc\x123\n\"de//f"
---tokens---
'a' Name.Function
-' ' Text
+' ' Text.Whitespace
'"' Literal.String
'abc' Literal.String
'\\x12' Literal.String.Escape