comparison src/misc1.c @ 1336:b8ebbfa519b9 v7.1.050

updated for version 7.1-050
author vimboss
date Sat, 04 Aug 2007 10:14:52 +0000
parents 60d21d224d25
children 2ae2dd2591fa
comparison
equal deleted inserted replaced
1335:251307ebe1db 1336:b8ebbfa519b9
4818 static int cin_iselse __ARGS((char_u *)); 4818 static int cin_iselse __ARGS((char_u *));
4819 static int cin_isdo __ARGS((char_u *)); 4819 static int cin_isdo __ARGS((char_u *));
4820 static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int)); 4820 static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
4821 static int cin_iswhileofdo_end __ARGS((int terminated, int ind_maxparen, int ind_maxcomment)); 4821 static int cin_iswhileofdo_end __ARGS((int terminated, int ind_maxparen, int ind_maxcomment));
4822 static int cin_isbreak __ARGS((char_u *)); 4822 static int cin_isbreak __ARGS((char_u *));
4823 static int cin_is_cpp_baseclass __ARGS((char_u *line, colnr_T *col)); 4823 static int cin_is_cpp_baseclass __ARGS((colnr_T *col));
4824 static int get_baseclass_amount __ARGS((int col, int ind_maxparen, int ind_maxcomment, int ind_cpp_baseclass)); 4824 static int get_baseclass_amount __ARGS((int col, int ind_maxparen, int ind_maxcomment, int ind_cpp_baseclass));
4825 static int cin_ends_in __ARGS((char_u *, char_u *, char_u *)); 4825 static int cin_ends_in __ARGS((char_u *, char_u *, char_u *));
4826 static int cin_skip2pos __ARGS((pos_T *trypos)); 4826 static int cin_skip2pos __ARGS((pos_T *trypos));
4827 static pos_T *find_start_brace __ARGS((int)); 4827 static pos_T *find_start_brace __ARGS((int));
4828 static pos_T *find_match_paren __ARGS((int, int)); 4828 static pos_T *find_match_paren __ARGS((int, int));
5583 * baseClass(...) <-- here (constructor-initialization) 5583 * baseClass(...) <-- here (constructor-initialization)
5584 * 5584 *
5585 * This is a lot of guessing. Watch out for "cond ? func() : foo". 5585 * This is a lot of guessing. Watch out for "cond ? func() : foo".
5586 */ 5586 */
5587 static int 5587 static int
5588 cin_is_cpp_baseclass(line, col) 5588 cin_is_cpp_baseclass(col)
5589 char_u *line;
5590 colnr_T *col; /* return: column to align with */ 5589 colnr_T *col; /* return: column to align with */
5591 { 5590 {
5592 char_u *s; 5591 char_u *s;
5593 int class_or_struct, lookfor_ctor_init, cpp_base_class; 5592 int class_or_struct, lookfor_ctor_init, cpp_base_class;
5594 linenr_T lnum = curwin->w_cursor.lnum; 5593 linenr_T lnum = curwin->w_cursor.lnum;
5594 char_u *line = ml_get_curline();
5595 5595
5596 *col = 0; 5596 *col = 0;
5597 5597
5598 s = skipwhite(line); 5598 s = skipwhite(line);
5599 if (*s == '#') /* skip #define FOO x ? (x) : x */ 5599 if (*s == '#') /* skip #define FOO x ? (x) : x */
5617 * somethingelse(3) 5617 * somethingelse(3)
5618 * {} 5618 * {}
5619 */ 5619 */
5620 while (lnum > 1) 5620 while (lnum > 1)
5621 { 5621 {
5622 s = skipwhite(ml_get(lnum - 1)); 5622 line = ml_get(lnum - 1);
5623 s = skipwhite(line);
5623 if (*s == '#' || *s == NUL) 5624 if (*s == '#' || *s == NUL)
5624 break; 5625 break;
5625 while (*s != NUL) 5626 while (*s != NUL)
5626 { 5627 {
5627 s = cin_skipcomment(s); 5628 s = cin_skipcomment(s);
5634 if (*s != NUL) 5635 if (*s != NUL)
5635 break; 5636 break;
5636 --lnum; 5637 --lnum;
5637 } 5638 }
5638 5639
5639 s = cin_skipcomment(ml_get(lnum)); 5640 line = ml_get(lnum);
5641 s = cin_skipcomment(line);
5640 for (;;) 5642 for (;;)
5641 { 5643 {
5642 if (*s == NUL) 5644 if (*s == NUL)
5643 { 5645 {
5644 if (lnum == curwin->w_cursor.lnum) 5646 if (lnum == curwin->w_cursor.lnum)
5645 break; 5647 break;
5646 /* Continue in the cursor line. */ 5648 /* Continue in the cursor line. */
5647 s = cin_skipcomment(ml_get(++lnum)); 5649 line = ml_get(++lnum);
5650 s = cin_skipcomment(line);
5651 if (*s == NUL)
5652 continue;
5648 } 5653 }
5649 5654
5650 if (s[0] == ':') 5655 if (s[0] == ':')
5651 { 5656 {
5652 if (s[1] == ':') 5657 if (s[1] == ':')
7111 * constructor initialization? 7116 * constructor initialization?
7112 */ /* XXX */ 7117 */ /* XXX */
7113 n = FALSE; 7118 n = FALSE;
7114 if (lookfor != LOOKFOR_TERM && ind_cpp_baseclass > 0) 7119 if (lookfor != LOOKFOR_TERM && ind_cpp_baseclass > 0)
7115 { 7120 {
7116 n = cin_is_cpp_baseclass(l, &col); 7121 n = cin_is_cpp_baseclass(&col);
7117 l = ml_get_curline(); 7122 l = ml_get_curline();
7118 } 7123 }
7119 if (n) 7124 if (n)
7120 { 7125 {
7121 if (lookfor == LOOKFOR_UNTERM) 7126 if (lookfor == LOOKFOR_UNTERM)
7702 * constructor initialization? 7707 * constructor initialization?
7703 */ /* XXX */ 7708 */ /* XXX */
7704 n = FALSE; 7709 n = FALSE;
7705 if (ind_cpp_baseclass != 0 && theline[0] != '{') 7710 if (ind_cpp_baseclass != 0 && theline[0] != '{')
7706 { 7711 {
7707 n = cin_is_cpp_baseclass(l, &col); 7712 n = cin_is_cpp_baseclass(&col);
7708 l = ml_get_curline(); 7713 l = ml_get_curline();
7709 } 7714 }
7710 if (n) 7715 if (n)
7711 { 7716 {
7712 /* XXX */ 7717 /* XXX */