From 22eed4c41729f1a8caed3ea366a05ec1bb72557c Mon Sep 17 00:00:00 2001 From: Mike Sinkovsky Date: Tue, 17 Jan 2017 12:57:20 +0500 Subject: [PATCH] cleanup: Redundant character escape --- mesonbuild/backend/backends.py | 2 +- mesonbuild/mparser.py | 6 +++--- tools/cmake2meson.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 56c786b5a..26cba40bf 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -618,7 +618,7 @@ class Backend(): dfilename = os.path.join(outdir, target.depfile) i = i.replace('@DEPFILE@', dfilename) elif '@PRIVATE_OUTDIR_' in i: - match = re.search('@PRIVATE_OUTDIR_(ABS_)?([^\/\s*]*)@', i) + match = re.search('@PRIVATE_OUTDIR_(ABS_)?([^/\s*]*)@', i) if not match: msg = 'Custom target {!r} has an invalid argument {!r}' \ ''.format(target.name, i) diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index fa8ade2cc..a0053170a 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -47,7 +47,7 @@ class Lexer: ('eol_cont', re.compile(r'\\\n')), ('eol', re.compile(r'\n')), ('multiline_string', re.compile(r"'''(.|\n)*?'''", re.M)), - ('comment', re.compile(r'\#.*')), + ('comment', re.compile(r'#.*')), ('lparen', re.compile(r'\(')), ('rparen', re.compile(r'\)')), ('lbracket', re.compile(r'\[')), @@ -60,11 +60,11 @@ class Lexer: ('plus', re.compile(r'\+')), ('dash', re.compile(r'-')), ('star', re.compile(r'\*')), - ('percent', re.compile(r'\%')), + ('percent', re.compile(r'%')), ('fslash', re.compile(r'/')), ('colon', re.compile(r':')), ('equal', re.compile(r'==')), - ('nequal', re.compile(r'\!=')), + ('nequal', re.compile(r'!=')), ('assign', re.compile(r'=')), ('le', re.compile(r'<=')), ('lt', re.compile(r'<')), diff --git a/tools/cmake2meson.py b/tools/cmake2meson.py index 647d0c30d..9f2c7c00f 100755 --- a/tools/cmake2meson.py +++ b/tools/cmake2meson.py @@ -38,7 +38,7 @@ class Lexer: ('varexp', re.compile(r'\${[-_0-9a-z/A-Z.]+}')), ('id', re.compile('''[,-><${}=+_0-9a-z/A-Z|@.*]+''')), ('eol', re.compile(r'\n')), - ('comment', re.compile(r'\#.*')), + ('comment', re.compile(r'#.*')), ('lparen', re.compile(r'\(')), ('rparen', re.compile(r'\)')), ]