From: David Lord Date: Mon, 3 Jul 2017 16:40:07 +0000 (-0700) Subject: remove unnecessary \b from name regex X-Git-Tag: 2.10~22^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f1f031c2ec7524fd7fb6b3ba264f045704f432d;p=thirdparty%2Fjinja.git remove unnecessary \b from name regex --- diff --git a/jinja2/lexer.py b/jinja2/lexer.py index 325b8471..6c2b2327 100644 --- a/jinja2/lexer.py +++ b/jinja2/lexer.py @@ -15,14 +15,12 @@ :license: BSD, see LICENSE for more details. """ import re -import sys - -from operator import itemgetter from collections import deque +from operator import itemgetter + +from jinja2._compat import implements_iterator, intern, iteritems, text_type from jinja2.exceptions import TemplateSyntaxError from jinja2.utils import LRUCache -from jinja2._compat import iteritems, implements_iterator, text_type, intern - # cache for the lexers. Exists in order to be able to have multiple # environments with the same lexer @@ -39,7 +37,7 @@ integer_re = re.compile(r'\d+') try: compile('föö', '', 'eval') except SyntaxError: - name_re = re.compile(r'\b[a-zA-Z_][a-zA-Z0-9_]*\b') + name_re = re.compile(r'[a-zA-Z_][a-zA-Z0-9_]*') check_ident = False else: # for whatever reason these do not exist in 'some' verisons of @@ -48,7 +46,7 @@ else: # 0x1886 MONGOLIAN LETTER ALI GALI THREE BALUDA # 0x2118 SCRIPT CAPITAL P # 0x212e ESTIMATED SYMBOL - name_re = re.compile(r'\b[\w\u1885\u1886\u2118\u212e]+\b') + name_re = re.compile(r'[\w\u1885\u1886\u2118\u212e]+') check_ident = True float_re = re.compile(r'(?