Ignore:
Timestamp:
Sep 6, 2013, 9:36:08 PM (7 years ago)
Author:
Stefano Rivera <stefano@…>
Branch:
default
Message:

Colons are allowed in strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/yamlish.py

    r344 r380  
    101101        if data in ('true', 'false', 'null'):
    102102            return "'%s'" % data
    103         if "'" in data:
     103        if "'" in data or ':' in data or data.startswith('['):
    104104            return "'%s'" % data.replace("'", "''")
    105105        if data == '':
     
    124124    _spaces_re = re.compile(r'^(\s*)(.*)')
    125125    _list_re = re.compile(r'^(-\s+)(.*)')
    126     _dict_re = re.compile(r'^((?![{[])[^-:]+):\s?(.*)')
     126    _dict_re = re.compile(r"^((?![{['])[^-:]+):\s?(.*)")
    127127    _inline_list_re = re.compile(r"^([^',]+|(?:'')+|'.+?[^'](?:'')*')"
    128128                                 r"(?:, (.*))?$")
Note: See TracChangeset for help on using the changeset viewer.