summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pygments/lexers/sql.py3
-rw-r--r--tests/test_sql.py4
2 files changed, 6 insertions, 1 deletions
diff --git a/pygments/lexers/sql.py b/pygments/lexers/sql.py
index a4cbc941..1ff332dc 100644
--- a/pygments/lexers/sql.py
+++ b/pygments/lexers/sql.py
@@ -509,7 +509,8 @@ class TransactSqlLexer(RegexLexer):
(words(_tsql_builtins.KEYWORDS, suffix=r'\b'), Keyword),
(r'(\[)([^]]+)(\])', bygroups(Operator, Name, Operator)),
(r'0x[0-9a-f]+', Number.Hex),
- (r'[0-9]*\.?[0-9]+(e[+-]?[0-9]+)?', Number.Float),
+ (r'[0-9]*\.[0-9]+(e[+-]?[0-9]+)?', Number.Float), # e.g. 1.23e45
+ (r'[0-9]+e[+-]?[0-9]+', Number.Float), # e.g. 123e45
(r'[0-9]+', Number.Integer),
(r"'(''|[^'])*'", String.Single),
(r'"(""|[^"])*"', String.Symbol),
diff --git a/tests/test_sql.py b/tests/test_sql.py
index f4016918..674d0426 100644
--- a/tests/test_sql.py
+++ b/tests/test_sql.py
@@ -48,6 +48,10 @@ class TransactSqlLexerTest(unittest.TestCase):
((Number.Float, '1e2'), (Number.Float, '.1e2'))
)
+ def test_can_lex_integer(self):
+ self._assertAreTokensOfType(
+ '1 23 456', Number.Integer)
+
def test_can_lex_names(self):
self._assertAreTokensOfType(
u'thingy thingy123 _thingy _ _123 Ähnliches Müll #temp1 ##temp2', Name)