From 08e4a953940c1d748726d9a277816809d56e19ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B3th=20B=C3=A9la?= Date: Fri, 14 Sep 2018 08:22:35 +0200 Subject: [PATCH] Update regular expressions in gen-magic-strings.py (#2527) In their past form, they could not recognize preprocessor directives, if they didn't start on column 0. Updated them to fix this problem. JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu --- tools/gen-magic-strings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/gen-magic-strings.py b/tools/gen-magic-strings.py index 970ab3d83..9c22b5f7f 100755 --- a/tools/gen-magic-strings.py +++ b/tools/gen-magic-strings.py @@ -119,10 +119,10 @@ def extract_magic_string_refs(debug=False): guard_stack = [] for line in fileinput.input(fname): - if_match = re.match('^# *if(.*)', line) - elif_match = re.match('^# *elif(.*)', line) - else_match = re.match('^# *else', line) - endif_match = re.match('^# *endif', line) + if_match = re.match('^ *# *if(.*)', line) + elif_match = re.match('^ *# *elif(.*)', line) + else_match = re.match('^ *# *else', line) + endif_match = re.match('^ *# *endif', line) if if_match is not None: guard_stack.append([process_guard(if_match.group(1))]) elif elif_match is not None: