MediaWiki  1.23.2
csslex Namespace Reference

Variables

list __all__ = [ "NEWLINE", "HEX", "NON_ASCII", "UNICODE", "ESCAPE", "NMSTART", "NMCHAR", "STRING1", "STRING2", "IDENT", "NAME", "HASH", "NUM", "STRING", "URL", "SPACE", "WHITESPACE", "COMMENT", "QUANTITY", "PUNC" ]
 
list __author__
 
string COMMENT = r'/\*[^*]*\*+([^/*][^*]*\*+)*/'
 
string ESCAPE = r'(?:' + UNICODE + r'|\\[^\r\n\f0-9a-f])'
 
string HASH = r'#' + NAME
 
string HEX = r'[0-9a-f]'
 
string IDENT = r'-?' + NMSTART + NMCHAR + '*'
 
string KEYWORD = r'(?:\@(?:import|page|media|charset))'
 
string NAME = NMCHAR + r'+'
 
string NEWLINE = r'\n|\r\n|\r|\f'
 
string NMCHAR = r'(?:[_a-z0-9-]|' + NON_ASCII + r'|' + ESCAPE + r')'
 
string NMSTART = r'(?:[_a-z]|' + NON_ASCII + r'|' + ESCAPE + r')'
 
string NON_ASCII = r'[\200-\377]'
 
string NUM = r'(?:[0-9]*\.[0-9]+|[0-9]+)'
 
string PUNC = r'<!--|-->|~=|\|=|[\{\+>,:;]'
 
string QUANTITY = '%s(?:%s%s|%s)?' % (NUM, WHITESPACE, UNIT, IDENT)
 
string SPACE = r'[ \t\r\n\f]'
 
string STRING = '(?:' + STRING1 + r'|' + STRING2 + ')'
 
string STRING1 = r'"(?:[^\"\\]|\\.)*"'
 
string STRING2 = r"'(?:[^\'\\]|\\.)*'"
 
string UNICODE = r'(?:(?:\\' + HEX + r'{1,6})(?:\r\n|[ \t\r\n\f])?)'
 
string UNIT = r'(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)'
 
string URL = r'url\(%s(%s|%s)%s\)' % (WHITESPACE, STRING, URL_CHARS, WHITESPACE)
 
string URL_CHARS = r'(?:%s|%s|%s)*' % (URL_SPECIAL_CHARS, NON_ASCII, ESCAPE)
 
string URL_SPECIAL_CHARS = r'[!#$%&*-~]'
 
string WHITESPACE = '(?:' + SPACE + r'*)'
 

Variable Documentation

◆ __all__

list csslex.__all__ = [ "NEWLINE", "HEX", "NON_ASCII", "UNICODE", "ESCAPE", "NMSTART", "NMCHAR", "STRING1", "STRING2", "IDENT", "NAME", "HASH", "NUM", "STRING", "URL", "SPACE", "WHITESPACE", "COMMENT", "QUANTITY", "PUNC" ]
private

Definition at line 14 of file csslex.py.

◆ __author__

list csslex.__author__
private
Initial value:
1 = ['elsigh@google.com (Lindsey Simon)',
2  'msamuel@google.com (Mike Samuel)']

Definition at line 10 of file csslex.py.

◆ COMMENT

string csslex.COMMENT = r'/\*[^*]*\*+([^/*][^*]*\*+)*/'

Definition at line 83 of file csslex.py.

◆ ESCAPE

string csslex.ESCAPE = r'(?:' + UNICODE + r'|\\[^\r\n\f0-9a-f])'

Definition at line 37 of file csslex.py.

◆ HASH

string csslex.HASH = r'#' + NAME

Definition at line 52 of file csslex.py.

◆ HEX

string csslex.HEX = r'[0-9a-f]'

Definition at line 28 of file csslex.py.

◆ IDENT

string csslex.IDENT = r'-?' + NMSTART + NMCHAR + '*'

Definition at line 46 of file csslex.py.

◆ KEYWORD

string csslex.KEYWORD = r'(?:\@(?:import|page|media|charset))'

Definition at line 22 of file csslex.py.

◆ NAME

string csslex.NAME = NMCHAR + r'+'

Definition at line 49 of file csslex.py.

◆ NEWLINE

string csslex.NEWLINE = r'\n|\r\n|\r|\f'

Definition at line 25 of file csslex.py.

◆ NMCHAR

string csslex.NMCHAR = r'(?:[_a-z0-9-]|' + NON_ASCII + r'|' + ESCAPE + r')'

Definition at line 43 of file csslex.py.

◆ NMSTART

string csslex.NMSTART = r'(?:[_a-z]|' + NON_ASCII + r'|' + ESCAPE + r')'

Definition at line 40 of file csslex.py.

◆ NON_ASCII

string csslex.NON_ASCII = r'[\200-\377]'

Definition at line 31 of file csslex.py.

◆ NUM

string csslex.NUM = r'(?:[0-9]*\.[0-9]+|[0-9]+)'

Definition at line 64 of file csslex.py.

◆ PUNC

string csslex.PUNC = r'<!--|-->|~=|\|=|[\{\+>,:;]'

Definition at line 114 of file csslex.py.

◆ QUANTITY

string csslex.QUANTITY = '%s(?:%s%s|%s)?' % (NUM, WHITESPACE, UNIT, IDENT)

Definition at line 104 of file csslex.py.

◆ SPACE

string csslex.SPACE = r'[ \t\r\n\f]'

Definition at line 67 of file csslex.py.

◆ STRING

string csslex.STRING = '(?:' + STRING1 + r'|' + STRING2 + ')'

Definition at line 61 of file csslex.py.

◆ STRING1

string csslex.STRING1 = r'"(?:[^\"\\]|\\.)*"'

Definition at line 55 of file csslex.py.

◆ STRING2

string csslex.STRING2 = r"'(?:[^\'\\]|\\.)*'"

Definition at line 58 of file csslex.py.

◆ UNICODE

string csslex.UNICODE = r'(?:(?:\\' + HEX + r'{1,6})(?:\r\n|[ \t\r\n\f])?)'

Definition at line 34 of file csslex.py.

◆ UNIT

string csslex.UNIT = r'(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)'

Definition at line 101 of file csslex.py.

◆ URL

string csslex.URL = r'url\(%s(%s|%s)%s\)' % (WHITESPACE, STRING, URL_CHARS, WHITESPACE)

Definition at line 79 of file csslex.py.

◆ URL_CHARS

string csslex.URL_CHARS = r'(?:%s|%s|%s)*' % (URL_SPECIAL_CHARS, NON_ASCII, ESCAPE)

Definition at line 76 of file csslex.py.

◆ URL_SPECIAL_CHARS

string csslex.URL_SPECIAL_CHARS = r'[!#$%&*-~]'

Definition at line 73 of file csslex.py.

◆ WHITESPACE

string csslex.WHITESPACE = '(?:' + SPACE + r'*)'

Definition at line 70 of file csslex.py.

Referenced by DumpTestCase.skipWhitespace().