File tree Expand file tree Collapse file tree 1 file changed +4
-12
lines changed
Expand file tree Collapse file tree 1 file changed +4
-12
lines changed Original file line number Diff line number Diff line change @@ -477,19 +477,11 @@ def loads(data, conf=True):
477477 index += m .end ()
478478 continue
479479
480- key_with_quoted = r'^\s*(\S*?)\s*"([^"]+)";?|\'([^\']+)\';?|\\S+;?'
481- key_wo_quoted = r'^\s*([a-zA-Z0-9-_]+?)\s+(.+?);'
482- m1 = re .compile (key_with_quoted , re .S ).search (data [index :])
483- m2 = re .compile (key_wo_quoted , re .S ).search (data [index :])
484- if m1 and m2 :
485- if m1 .start () <= m2 .start ():
486- m = m1
487- else :
488- m = m2
489- else :
490- m = m1 or m2
480+ string_combos = r'[^;]+|"([^"]+)"|\'([^\']+)\''
481+ key = r'^\s*({})\s+({})\s*([^;]*?);' .format (string_combos , string_combos )
482+ m = re .compile (key , re .S ).search (data [index :])
491483 if m :
492- k = Key (m .group (1 ), m .group (2 ))
484+ k = Key (m .group (1 ), m .group (4 ) + m . group ( 7 ))
493485 if lopen and isinstance (lopen [0 ], (Container , Server )):
494486 lopen [0 ].add (k )
495487 else :
You can’t perform that action at this time.
0 commit comments