Mercurial > vim
comparison src/syntax.c @ 11129:f4ea50924c6d v8.0.0452
patch 8.0.0452: some macros are in lower case
commit https://github.com/vim/vim/commit/1c46544412382db8b3203d6c78e550df885540bd
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 12 20:10:05 2017 +0100
patch 8.0.0452: some macros are in lower case
Problem: Some macros are in lower case.
Solution: Make a few more macros upper case.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 12 Mar 2017 20:15:06 +0100 |
parents | 506f5d8b7d8b |
children | 501f46f7644c |
comparison
equal
deleted
inserted
replaced
11128:23154628ab7f | 11129:f4ea50924c6d |
---|---|
2306 */ | 2306 */ |
2307 if (!found_match) | 2307 if (!found_match) |
2308 { | 2308 { |
2309 line = syn_getcurline(); | 2309 line = syn_getcurline(); |
2310 if (((current_next_flags & HL_SKIPWHITE) | 2310 if (((current_next_flags & HL_SKIPWHITE) |
2311 && vim_iswhite(line[current_col])) | 2311 && VIM_ISWHITE(line[current_col])) |
2312 || ((current_next_flags & HL_SKIPEMPTY) | 2312 || ((current_next_flags & HL_SKIPEMPTY) |
2313 && *line == NUL)) | 2313 && *line == NUL)) |
2314 break; | 2314 break; |
2315 } | 2315 } |
2316 | 2316 |
4629 { | 4629 { |
4630 p = flagtab[fidx].name; | 4630 p = flagtab[fidx].name; |
4631 for (i = 0, len = 0; p[i] != NUL; i += 2, ++len) | 4631 for (i = 0, len = 0; p[i] != NUL; i += 2, ++len) |
4632 if (arg[len] != p[i] && arg[len] != p[i + 1]) | 4632 if (arg[len] != p[i] && arg[len] != p[i + 1]) |
4633 break; | 4633 break; |
4634 if (p[i] == NUL && (vim_iswhite(arg[len]) | 4634 if (p[i] == NUL && (VIM_ISWHITE(arg[len]) |
4635 || (flagtab[fidx].argtype > 0 | 4635 || (flagtab[fidx].argtype > 0 |
4636 ? arg[len] == '=' | 4636 ? arg[len] == '=' |
4637 : ends_excmd(arg[len])))) | 4637 : ends_excmd(arg[len])))) |
4638 { | 4638 { |
4639 if (opt->keyword | 4639 if (opt->keyword |
4903 rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, | 4903 rest = get_syn_options(rest, &syn_opt_arg, &conceal_char, |
4904 eap->skip); | 4904 eap->skip); |
4905 if (rest == NULL || ends_excmd(*rest)) | 4905 if (rest == NULL || ends_excmd(*rest)) |
4906 break; | 4906 break; |
4907 /* Copy the keyword, removing backslashes, and add a NUL. */ | 4907 /* Copy the keyword, removing backslashes, and add a NUL. */ |
4908 while (*rest != NUL && !vim_iswhite(*rest)) | 4908 while (*rest != NUL && !VIM_ISWHITE(*rest)) |
4909 { | 4909 { |
4910 if (*rest == '\\' && rest[1] != NUL) | 4910 if (*rest == '\\' && rest[1] != NUL) |
4911 ++rest; | 4911 ++rest; |
4912 *p++ = *rest++; | 4912 *p++ = *rest++; |
4913 } | 4913 } |
5154 if (rest == NULL || ends_excmd(*rest)) | 5154 if (rest == NULL || ends_excmd(*rest)) |
5155 break; | 5155 break; |
5156 | 5156 |
5157 /* must be a pattern or matchgroup then */ | 5157 /* must be a pattern or matchgroup then */ |
5158 key_end = rest; | 5158 key_end = rest; |
5159 while (*key_end && !vim_iswhite(*key_end) && *key_end != '=') | 5159 while (*key_end && !VIM_ISWHITE(*key_end) && *key_end != '=') |
5160 ++key_end; | 5160 ++key_end; |
5161 vim_free(key); | 5161 vim_free(key); |
5162 key = vim_strnsave_up(rest, (int)(key_end - rest)); | 5162 key = vim_strnsave_up(rest, (int)(key_end - rest)); |
5163 if (key == NULL) /* out of memory */ | 5163 if (key == NULL) /* out of memory */ |
5164 { | 5164 { |
5638 scl_id -= SYNID_CLUSTER; | 5638 scl_id -= SYNID_CLUSTER; |
5639 | 5639 |
5640 for (;;) | 5640 for (;;) |
5641 { | 5641 { |
5642 if (STRNICMP(rest, "add", 3) == 0 | 5642 if (STRNICMP(rest, "add", 3) == 0 |
5643 && (vim_iswhite(rest[3]) || rest[3] == '=')) | 5643 && (VIM_ISWHITE(rest[3]) || rest[3] == '=')) |
5644 { | 5644 { |
5645 opt_len = 3; | 5645 opt_len = 3; |
5646 list_op = CLUSTER_ADD; | 5646 list_op = CLUSTER_ADD; |
5647 } | 5647 } |
5648 else if (STRNICMP(rest, "remove", 6) == 0 | 5648 else if (STRNICMP(rest, "remove", 6) == 0 |
5649 && (vim_iswhite(rest[6]) || rest[6] == '=')) | 5649 && (VIM_ISWHITE(rest[6]) || rest[6] == '=')) |
5650 { | 5650 { |
5651 opt_len = 6; | 5651 opt_len = 6; |
5652 list_op = CLUSTER_SUBTRACT; | 5652 list_op = CLUSTER_SUBTRACT; |
5653 } | 5653 } |
5654 else if (STRNICMP(rest, "contains", 8) == 0 | 5654 else if (STRNICMP(rest, "contains", 8) == 0 |
5655 && (vim_iswhite(rest[8]) || rest[8] == '=')) | 5655 && (VIM_ISWHITE(rest[8]) || rest[8] == '=')) |
5656 { | 5656 { |
5657 opt_len = 8; | 5657 opt_len = 8; |
5658 list_op = CLUSTER_REPLACE; | 5658 list_op = CLUSTER_REPLACE; |
5659 } | 5659 } |
5660 else | 5660 else |
5791 ++end; | 5791 ++end; |
5792 } | 5792 } |
5793 } | 5793 } |
5794 } while (idx >= 0); | 5794 } while (idx >= 0); |
5795 | 5795 |
5796 if (!ends_excmd(*end) && !vim_iswhite(*end)) | 5796 if (!ends_excmd(*end) && !VIM_ISWHITE(*end)) |
5797 { | 5797 { |
5798 EMSG2(_("E402: Garbage after pattern: %s"), arg); | 5798 EMSG2(_("E402: Garbage after pattern: %s"), arg); |
5799 return NULL; | 5799 return NULL; |
5800 } | 5800 } |
5801 return skipwhite(end); | 5801 return skipwhite(end); |
6012 * parse the arguments after "contains" | 6012 * parse the arguments after "contains" |
6013 */ | 6013 */ |
6014 count = 0; | 6014 count = 0; |
6015 while (!ends_excmd(*p)) | 6015 while (!ends_excmd(*p)) |
6016 { | 6016 { |
6017 for (end = p; *end && !vim_iswhite(*end) && *end != ','; ++end) | 6017 for (end = p; *end && !VIM_ISWHITE(*end) && *end != ','; ++end) |
6018 ; | 6018 ; |
6019 name = alloc((int)(end - p + 3)); /* leave room for "^$" */ | 6019 name = alloc((int)(end - p + 3)); /* leave room for "^$" */ |
6020 if (name == NULL) | 6020 if (name == NULL) |
6021 { | 6021 { |
6022 failed = TRUE; | 6022 failed = TRUE; |
7464 | 7464 |
7465 /* | 7465 /* |
7466 * Isolate the key ("term", "ctermfg", "ctermbg", "font", "guifg" or | 7466 * Isolate the key ("term", "ctermfg", "ctermbg", "font", "guifg" or |
7467 * "guibg"). | 7467 * "guibg"). |
7468 */ | 7468 */ |
7469 while (*linep && !vim_iswhite(*linep) && *linep != '=') | 7469 while (*linep && !VIM_ISWHITE(*linep) && *linep != '=') |
7470 ++linep; | 7470 ++linep; |
7471 vim_free(key); | 7471 vim_free(key); |
7472 key = vim_strnsave_up(key_start, (int)(linep - key_start)); | 7472 key = vim_strnsave_up(key_start, (int)(linep - key_start)); |
7473 if (key == NULL) | 7473 if (key == NULL) |
7474 { | 7474 { |
9719 * bold-underlined. | 9719 * bold-underlined. |
9720 */ | 9720 */ |
9721 attr = 0; | 9721 attr = 0; |
9722 for ( ; *p && *p != ','; ++p) /* parse upto comma */ | 9722 for ( ; *p && *p != ','; ++p) /* parse upto comma */ |
9723 { | 9723 { |
9724 if (vim_iswhite(*p)) /* ignore white space */ | 9724 if (VIM_ISWHITE(*p)) /* ignore white space */ |
9725 continue; | 9725 continue; |
9726 | 9726 |
9727 if (attr > HL_ALL) /* Combination with ':' is not allowed. */ | 9727 if (attr > HL_ALL) /* Combination with ':' is not allowed. */ |
9728 return FAIL; | 9728 return FAIL; |
9729 | 9729 |