Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, line, column, value):
Node.__init__(self, line, column)
self.value = value
try:
self.lower_value = ascii_lower(value)
except UnicodeEncodeError:
self.lower_value = value
def __init__(self, line, column, value, int_value, representation, unit):
Node.__init__(self, line, column)
self.value = value
self.int_value = int_value
self.is_integer = int_value is not None
self.representation = representation
self.unit = unit
self.lower_unit = ascii_lower(unit)
while css.startswith((' ', '\n', '\t'), pos):
pos += 1
tokens.append(WhitespaceToken(line, column))
continue
elif (c in 'Uu' and pos + 2 < length and css[pos + 1] == '+'
and css[pos + 2] in '0123456789abcdefABCDEF?'):
start, end, pos = _consume_unicode_range(css, pos + 2)
tokens.append(UnicodeRangeToken(line, column, start, end))
continue
elif _is_ident_start(css, pos):
value, pos = _consume_ident(css, pos)
if not css.startswith('(', pos): # Not a function
tokens.append(IdentToken(line, column, value))
continue
pos += 1 # Skip the '('
if ascii_lower(value) == 'url':
value, pos = _consume_url(css, pos)
tokens.append(
URLToken(line, column, value) if value is not None
else ParseError(line, column, 'bad-url', 'bad URL token'))
continue
arguments = []
tokens.append(Function(line, column, value, arguments))
stack.append((tokens, end_char))
end_char = ')'
tokens = arguments
continue
match = _NUMBER_RE.match(css, pos)
if match:
pos = match.end()
repr_ = css[token_start_pos:pos]
def __init__(self, line, column, name, arguments):
Node.__init__(self, line, column)
self.name = name
self.lower_name = ascii_lower(name)
self.arguments = arguments