]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Brace a block and fix indentation of another block
authorGuido van Rossum <guido@python.org>
Wed, 30 Jan 2019 16:26:12 +0000 (08:26 -0800)
committerGuido van Rossum <guido@python.org>
Wed, 30 Jan 2019 17:18:27 +0000 (09:18 -0800)
Parser/tokenizer.c

index d9d7f999466ab80238e89ede6d53c78c82fcbafd..1ded9ade377156a0f9602da688a098190cb726a2 100644 (file)
@@ -1263,8 +1263,9 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end)
             prefix = type_comment_prefix;
             while (*prefix && p < tok->cur) {
                 if (*prefix == ' ') {
-                    while (*p == ' ' || *p == '\t')
+                    while (*p == ' ' || *p == '\t') {
                         p++;
+                    }
                 } else if (*prefix == *p) {
                     p++;
                 } else {
@@ -1284,10 +1285,10 @@ tok_get(struct tok_state *tok, char **p_start, char **p_end)
                 is_type_ignore = tok->cur >= p + 6 && memcmp(p, "ignore", 6) == 0;
                 p += 6;
                 while (is_type_ignore && p < tok->cur) {
-                  if (*p == '#')
-                      break;
-                  is_type_ignore = is_type_ignore && (*p == ' ' || *p == '\t');
-                  p++;
+                    if (*p == '#')
+                        break;
+                    is_type_ignore = is_type_ignore && (*p == ' ' || *p == '\t');
+                    p++;
                 }
 
                 if (is_type_ignore) {