Mercurial > vim
comparison src/eval.c @ 11127:506f5d8b7d8b v8.0.0451
patch 8.0.0451: some macros are in lower case
commit https://github.com/vim/vim/commit/91acfffc1e6c0d8c2abfb186a0e79a5bf19c3f3f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 12 19:22:36 2017 +0100
patch 8.0.0451: some macros are in lower case
Problem: Some macros are in lower case.
Solution: Make a few more macros upper case. Avoid lower case macros use an
argument twice.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Mar 2017 19:30:05 +0100 |
parents | bcbda8ae5549 |
children | f4ea50924c6d |
comparison
equal
deleted
inserted
replaced
11126:48599a3eae0b | 11127:506f5d8b7d8b |
---|---|
2549 { | 2549 { |
2550 /* ":let var1 var2 ...": find last space. */ | 2550 /* ":let var1 var2 ...": find last space. */ |
2551 for (p = arg + STRLEN(arg); p >= arg; ) | 2551 for (p = arg + STRLEN(arg); p >= arg; ) |
2552 { | 2552 { |
2553 xp->xp_pattern = p; | 2553 xp->xp_pattern = p; |
2554 mb_ptr_back(arg, p); | 2554 MB_PTR_BACK(arg, p); |
2555 if (vim_iswhite(*p)) | 2555 if (vim_iswhite(*p)) |
2556 break; | 2556 break; |
2557 } | 2557 } |
2558 return; | 2558 return; |
2559 } | 2559 } |
4812 int extra = 0; | 4812 int extra = 0; |
4813 | 4813 |
4814 /* | 4814 /* |
4815 * Find the end of the string, skipping backslashed characters. | 4815 * Find the end of the string, skipping backslashed characters. |
4816 */ | 4816 */ |
4817 for (p = *arg + 1; *p != NUL && *p != '"'; mb_ptr_adv(p)) | 4817 for (p = *arg + 1; *p != NUL && *p != '"'; MB_PTR_ADV(p)) |
4818 { | 4818 { |
4819 if (*p == '\\' && p[1] != NUL) | 4819 if (*p == '\\' && p[1] != NUL) |
4820 { | 4820 { |
4821 ++p; | 4821 ++p; |
4822 /* A "\<x>" form occupies at least 4 characters, and produces up | 4822 /* A "\<x>" form occupies at least 4 characters, and produces up |
4950 int reduce = 0; | 4950 int reduce = 0; |
4951 | 4951 |
4952 /* | 4952 /* |
4953 * Find the end of the string, skipping ''. | 4953 * Find the end of the string, skipping ''. |
4954 */ | 4954 */ |
4955 for (p = *arg + 1; *p != NUL; mb_ptr_adv(p)) | 4955 for (p = *arg + 1; *p != NUL; MB_PTR_ADV(p)) |
4956 { | 4956 { |
4957 if (*p == '\'') | 4957 if (*p == '\'') |
4958 { | 4958 { |
4959 if (p[1] != '\'') | 4959 if (p[1] != '\'') |
4960 break; | 4960 break; |
5908 | 5908 |
5909 len = (function ? 13 : 3); | 5909 len = (function ? 13 : 3); |
5910 if (str != NULL) | 5910 if (str != NULL) |
5911 { | 5911 { |
5912 len += (unsigned)STRLEN(str); | 5912 len += (unsigned)STRLEN(str); |
5913 for (p = str; *p != NUL; mb_ptr_adv(p)) | 5913 for (p = str; *p != NUL; MB_PTR_ADV(p)) |
5914 if (*p == '\'') | 5914 if (*p == '\'') |
5915 ++len; | 5915 ++len; |
5916 } | 5916 } |
5917 s = r = alloc(len); | 5917 s = r = alloc(len); |
5918 if (r != NULL) | 5918 if (r != NULL) |
6367 for (p = arg; *p != NUL | 6367 for (p = arg; *p != NUL |
6368 && (eval_isnamec(*p) | 6368 && (eval_isnamec(*p) |
6369 || *p == '{' | 6369 || *p == '{' |
6370 || ((flags & FNE_INCL_BR) && (*p == '[' || *p == '.')) | 6370 || ((flags & FNE_INCL_BR) && (*p == '[' || *p == '.')) |
6371 || mb_nest != 0 | 6371 || mb_nest != 0 |
6372 || br_nest != 0); mb_ptr_adv(p)) | 6372 || br_nest != 0); MB_PTR_ADV(p)) |
6373 { | 6373 { |
6374 if (*p == '\'') | 6374 if (*p == '\'') |
6375 { | 6375 { |
6376 /* skip over 'string' to avoid counting [ and ] inside it. */ | 6376 /* skip over 'string' to avoid counting [ and ] inside it. */ |
6377 for (p = p + 1; *p != NUL && *p != '\''; mb_ptr_adv(p)) | 6377 for (p = p + 1; *p != NUL && *p != '\''; MB_PTR_ADV(p)) |
6378 ; | 6378 ; |
6379 if (*p == NUL) | 6379 if (*p == NUL) |
6380 break; | 6380 break; |
6381 } | 6381 } |
6382 else if (*p == '"') | 6382 else if (*p == '"') |
6383 { | 6383 { |
6384 /* skip over "str\"ing" to avoid counting [ and ] inside it. */ | 6384 /* skip over "str\"ing" to avoid counting [ and ] inside it. */ |
6385 for (p = p + 1; *p != NUL && *p != '"'; mb_ptr_adv(p)) | 6385 for (p = p + 1; *p != NUL && *p != '"'; MB_PTR_ADV(p)) |
6386 if (*p == '\\' && p[1] != NUL) | 6386 if (*p == '\\' && p[1] != NUL) |
6387 ++p; | 6387 ++p; |
6388 if (*p == NUL) | 6388 if (*p == NUL) |
6389 break; | 6389 break; |
6390 } | 6390 } |
9408 int hasTilde; | 9408 int hasTilde; |
9409 | 9409 |
9410 /* Count up the path separators from the RHS.. so we know which part | 9410 /* Count up the path separators from the RHS.. so we know which part |
9411 * of the path to return. */ | 9411 * of the path to return. */ |
9412 sepcount = 0; | 9412 sepcount = 0; |
9413 for (p = *fnamep; p < *fnamep + *fnamelen; mb_ptr_adv(p)) | 9413 for (p = *fnamep; p < *fnamep + *fnamelen; MB_PTR_ADV(p)) |
9414 if (vim_ispathsep(*p)) | 9414 if (vim_ispathsep(*p)) |
9415 ++sepcount; | 9415 ++sepcount; |
9416 | 9416 |
9417 /* Need full path first (use expand_env() to remove a "~/") */ | 9417 /* Need full path first (use expand_env() to remove a "~/") */ |
9418 hasTilde = (**fnamep == '~'); | 9418 hasTilde = (**fnamep == '~'); |
9526 if (*fnamep == NULL) | 9526 if (*fnamep == NULL) |
9527 return -1; | 9527 return -1; |
9528 } | 9528 } |
9529 | 9529 |
9530 /* When "/." or "/.." is used: force expansion to get rid of it. */ | 9530 /* When "/." or "/.." is used: force expansion to get rid of it. */ |
9531 for (p = *fnamep; *p != NUL; mb_ptr_adv(p)) | 9531 for (p = *fnamep; *p != NUL; MB_PTR_ADV(p)) |
9532 { | 9532 { |
9533 if (vim_ispathsep(*p) | 9533 if (vim_ispathsep(*p) |
9534 && p[1] == '.' | 9534 && p[1] == '.' |
9535 && (p[2] == NUL | 9535 && (p[2] == NUL |
9536 || vim_ispathsep(p[2]) | 9536 || vim_ispathsep(p[2]) |
9656 { | 9656 { |
9657 valid |= VALID_HEAD; | 9657 valid |= VALID_HEAD; |
9658 *usedlen += 2; | 9658 *usedlen += 2; |
9659 s = get_past_head(*fnamep); | 9659 s = get_past_head(*fnamep); |
9660 while (tail > s && after_pathsep(s, tail)) | 9660 while (tail > s && after_pathsep(s, tail)) |
9661 mb_ptr_back(*fnamep, tail); | 9661 MB_PTR_BACK(*fnamep, tail); |
9662 *fnamelen = (int)(tail - *fnamep); | 9662 *fnamelen = (int)(tail - *fnamep); |
9663 #ifdef VMS | 9663 #ifdef VMS |
9664 if (*fnamelen > 0) | 9664 if (*fnamelen > 0) |
9665 *fnamelen += 1; /* the path separator is part of the path */ | 9665 *fnamelen += 1; /* the path separator is part of the path */ |
9666 #endif | 9666 #endif |
9675 *fnamelen = 1; | 9675 *fnamelen = 1; |
9676 } | 9676 } |
9677 else | 9677 else |
9678 { | 9678 { |
9679 while (tail > s && !after_pathsep(s, tail)) | 9679 while (tail > s && !after_pathsep(s, tail)) |
9680 mb_ptr_back(*fnamep, tail); | 9680 MB_PTR_BACK(*fnamep, tail); |
9681 } | 9681 } |
9682 } | 9682 } |
9683 | 9683 |
9684 /* ":8" - shortname */ | 9684 /* ":8" - shortname */ |
9685 if (src[*usedlen] == ':' && src[*usedlen + 1] == '8') | 9685 if (src[*usedlen] == ':' && src[*usedlen + 1] == '8') |