diff options
author | Niklas Claesson <nicke.claesson@gmail.com> | 2018-04-19 17:58:38 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2018-04-21 22:57:19 +0300 |
commit | cb0960a91e1b250a00c0a1e4a40b7e86bc70a97d (patch) | |
tree | 923f5ed0f5930e16d497d20d77608827ce44df95 /mesonbuild/mparser.py | |
parent | 74404db469bc37fbe184cc708a19ccbe58bf83df (diff) | |
download | meson-cb0960a91e1b250a00c0a1e4a40b7e86bc70a97d.zip meson-cb0960a91e1b250a00c0a1e4a40b7e86bc70a97d.tar.gz meson-cb0960a91e1b250a00c0a1e4a40b7e86bc70a97d.tar.bz2 |
Remove escaping for triple-quoted strings
Fixes #3429
Diffstat (limited to 'mesonbuild/mparser.py')
-rw-r--r-- | mesonbuild/mparser.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index 9e43065..8cef377 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -28,18 +28,6 @@ ESCAPE_SEQUENCE_SINGLE_RE = re.compile(r''' | \\[\\'abfnrtv] # Single-character escapes )''', re.UNICODE | re.VERBOSE) -# This is the regex for the supported escape sequences of a multiline string -# literal, like '''abc\x00'''. The only difference is that single quote (') -# doesn't require escaping. -ESCAPE_SEQUENCE_MULTI_RE = re.compile(r''' - ( \\U........ # 8-digit hex escapes - | \\u.... # 4-digit hex escapes - | \\x.. # 2-digit hex escapes - | \\[0-7]{1,3} # Octal escapes - | \\N\{[^}]+\} # Unicode characters by name - | \\[\\abfnrtv] # Single-character escapes - )''', re.UNICODE | re.VERBOSE) - class MesonUnicodeDecodeError(MesonException): def __init__(self, match): super().__init__("%s" % match) @@ -187,10 +175,6 @@ This will become a hard error in a future Meson release.""", self.getline(line_s elif tid == 'multiline_string': tid = 'string' value = match_text[3:-3] - try: - value = ESCAPE_SEQUENCE_MULTI_RE.sub(decode_match, value) - except MesonUnicodeDecodeError as err: - raise MesonException("Failed to parse escape sequence: '{}' in string:\n{}".format(err.match, match_text)) lines = match_text.split('\n') if len(lines) > 1: lineno += len(lines) - 1 |