diff --git a/pygments/lexers/configs.py b/pygments/lexers/configs.py index 4e0e7f1282..6f61d98e41 100644 --- a/pygments/lexers/configs.py +++ b/pygments/lexers/configs.py @@ -128,14 +128,26 @@ class PropertiesLexer(RegexLexer): tokens = { 'root': [ - (r'^(\w+)([ \t])(\w+\s*)$', bygroups(Name.Attribute, Whitespace, String)), - (r'^\w+(\\[ \t]\w*)*$', Name.Attribute), - (r'(^ *)([#!].*)', bygroups(Whitespace, Comment)), - # More controversial comments - (r'(^ *)((?:;|//).*)', bygroups(Whitespace, Comment)), - (r'(.*?)([ \t]*)([=:])([ \t]*)(.*(?:(?<=\\)\n.*)*)', - bygroups(Name.Attribute, Whitespace, Operator, Whitespace, String)), - (r'\s', Whitespace), + (r'\s+', Whitespace), + (r'[!#].*|/{2}.*', Comment.Single), + # search for first separator + (r'([^\\\n]|\\.)*?(?=[ \f\t=:])', Name.Attribute, "separator"), + # empty key + (r'.+?$', Name.Attribute), + ], + 'separator': [ + # search for line continuation escape + (r'([ \f\t]*)([=:]*)([ \f\t]*)(.*(?