ThirdParty/Pygments/pygments/lexers/jvm.py

changeset 6651
e8f3b5568b21
parent 5713
6762afd9f963
equal deleted inserted replaced
6650:1dd52aa8897c 6651:e8f3b5568b21
255 u'\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e' 255 u'\ua74c\ua74e\ua750\ua752\ua754\ua756\ua758\ua75a\ua75c\ua75e'
256 u'\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b' 256 u'\ua760\ua762\ua764\ua766\ua768\ua76a\ua76c\ua76e\ua779\ua77b'
257 u'\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]') 257 u'\ua77d-\ua77e\ua780\ua782\ua784\ua786\ua78b\uff21-\uff3a]')
258 258
259 idrest = u'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op) 259 idrest = u'%s(?:%s|[0-9])*(?:(?<=_)%s)?' % (letter, letter, op)
260 letter_letter_digit = u'%s(?:%s|\d)*' % (letter, letter) 260 letter_letter_digit = u'%s(?:%s|\\d)*' % (letter, letter)
261 261
262 tokens = { 262 tokens = {
263 'root': [ 263 'root': [
264 # method names 264 # method names
265 (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'), 265 (r'(class|trait|object)(\s+)', bygroups(Keyword, Text), 'class'),
687 r'System|Text|Tuple)(?![\w!:?])', Name.Builtin), 687 r'System|Text|Tuple)(?![\w!:?])', Name.Builtin),
688 688
689 # functions 689 # functions
690 (u'(generateMatchMethod|aliasMethod|\u03bb|\u028E|fnx|fn|method|' 690 (u'(generateMatchMethod|aliasMethod|\u03bb|\u028E|fnx|fn|method|'
691 u'dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)' 691 u'dmacro|dlecro|syntax|macro|dlecrox|lecrox|lecro|syntax)'
692 u'(?![\w!:?])', Name.Function), 692 u'(?![\\w!:?])', Name.Function),
693 693
694 # Numbers 694 # Numbers
695 (r'-?0[xX][0-9a-fA-F]+', Number.Hex), 695 (r'-?0[xX][0-9a-fA-F]+', Number.Hex),
696 (r'-?(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), 696 (r'-?(\d+\.?\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float),
697 (r'-?\d+', Number.Integer), 697 (r'-?\d+', Number.Integer),
799 # well, names can only not consist fully of numbers 799 # well, names can only not consist fully of numbers
800 # but this should be good enough for now 800 # but this should be good enough for now
801 801
802 # TODO / should divide keywords/symbols into namespace/rest 802 # TODO / should divide keywords/symbols into namespace/rest
803 # but that's hard, so just pretend / is part of the name 803 # but that's hard, so just pretend / is part of the name
804 valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+' 804 valid_name = r'(?!#)[\w!$%*+<=>?/.#|-]+'
805 805
806 tokens = { 806 tokens = {
807 'root': [ 807 'root': [
808 # the comments - always starting with semicolon 808 # the comments - always starting with semicolon
809 # and going to the end of the line 809 # and going to the end of the line
1256 (r'0[0-7]+j?', Number.Oct), 1256 (r'0[0-7]+j?', Number.Oct),
1257 (r'0[xX][a-fA-F0-9]+', Number.Hex), 1257 (r'0[xX][a-fA-F0-9]+', Number.Hex),
1258 (r'-?\d[\d_]*L', Number.Integer.Long), 1258 (r'-?\d[\d_]*L', Number.Integer.Long),
1259 (r'-?\d[\d_]*', Number.Integer), 1259 (r'-?\d[\d_]*', Number.Integer),
1260 1260
1261 ('`?[a-zA-Z_][\w$]*', Name), 1261 (r'`?[a-zA-Z_][\w$]*', Name),
1262 (r'@[a-zA-Z_][\w$.]*', Name.Decorator), 1262 (r'@[a-zA-Z_][\w$.]*', Name.Decorator),
1263 1263
1264 (r'"""', String, combined('stringescape', 'triplestring')), 1264 (r'"""', String, combined('stringescape', 'triplestring')),
1265 (r'"', String, combined('stringescape', 'doublestring')), 1265 (r'"', String, combined('stringescape', 'doublestring')),
1266 (r"'", String, combined('stringescape', 'singlestring')), 1266 (r"'", String, combined('stringescape', 'singlestring')),

eric ide

mercurial