diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/syntax.c | 20 |
2 files changed, 23 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e2390acf373..d2fb087ce16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2000-06-20 Stefan Monnier <monnier@cs.yale.edu> | ||
| 2 | |||
| 3 | * syntax.c (describe_syntax): Recognize the `n'estable bit. | ||
| 4 | (Fforward_comment, scan_lists): | ||
| 5 | Check the comstyle of single-char comment-starters. | ||
| 6 | (scan_sexps_forward): Don't try to recognize `half comment-enders' if | ||
| 7 | we're just at the beginning of the comment (f.ex with (*) ... (*)). | ||
| 8 | |||
| 1 | 2000-06-20 Dave Love <fx@gnu.org> | 9 | 2000-06-20 Dave Love <fx@gnu.org> |
| 2 | 10 | ||
| 3 | * fns.c (make_hash_table, maybe_resize_hash_table): Cast arg of | 11 | * fns.c (make_hash_table, maybe_resize_hash_table): Cast arg of |
diff --git a/src/syntax.c b/src/syntax.c index 19e18127f0b..eedec27d549 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -970,7 +970,7 @@ describe_syntax (value) | |||
| 970 | Lisp_Object value; | 970 | Lisp_Object value; |
| 971 | { | 971 | { |
| 972 | register enum syntaxcode code; | 972 | register enum syntaxcode code; |
| 973 | char desc, start1, start2, end1, end2, prefix, comstyle; | 973 | char desc, start1, start2, end1, end2, prefix, comstyle, comnested; |
| 974 | char str[2]; | 974 | char str[2]; |
| 975 | Lisp_Object first, match_lisp; | 975 | Lisp_Object first, match_lisp; |
| 976 | 976 | ||
| @@ -1010,6 +1010,7 @@ describe_syntax (value) | |||
| 1010 | end2 = (XINT (first) >> 19) & 1; | 1010 | end2 = (XINT (first) >> 19) & 1; |
| 1011 | prefix = (XINT (first) >> 20) & 1; | 1011 | prefix = (XINT (first) >> 20) & 1; |
| 1012 | comstyle = (XINT (first) >> 21) & 1; | 1012 | comstyle = (XINT (first) >> 21) & 1; |
| 1013 | comnested = (XINT (first) >> 22) & 1; | ||
| 1013 | 1014 | ||
| 1014 | if ((int) code < 0 || (int) code >= (int) Smax) | 1015 | if ((int) code < 0 || (int) code >= (int) Smax) |
| 1015 | { | 1016 | { |
| @@ -1040,6 +1041,8 @@ describe_syntax (value) | |||
| 1040 | insert ("p", 1); | 1041 | insert ("p", 1); |
| 1041 | if (comstyle) | 1042 | if (comstyle) |
| 1042 | insert ("b", 1); | 1043 | insert ("b", 1); |
| 1044 | if (comnested) | ||
| 1045 | insert ("n", 1); | ||
| 1043 | 1046 | ||
| 1044 | insert_string ("\twhich means: "); | 1047 | insert_string ("\twhich means: "); |
| 1045 | 1048 | ||
| @@ -1093,6 +1096,8 @@ describe_syntax (value) | |||
| 1093 | insert_string (",\n\t is the second character of a comment-end sequence"); | 1096 | insert_string (",\n\t is the second character of a comment-end sequence"); |
| 1094 | if (comstyle) | 1097 | if (comstyle) |
| 1095 | insert_string (" (comment style b)"); | 1098 | insert_string (" (comment style b)"); |
| 1099 | if (comnested) | ||
| 1100 | insert_string (" (nestable)"); | ||
| 1096 | 1101 | ||
| 1097 | if (prefix) | 1102 | if (prefix) |
| 1098 | insert_string (",\n\t is a prefix character for `backward-prefix-chars'"); | 1103 | insert_string (",\n\t is a prefix character for `backward-prefix-chars'"); |
| @@ -1777,9 +1782,9 @@ between them, return t; otherwise return nil.") | |||
| 1777 | code = SYNTAX (c); | 1782 | code = SYNTAX (c); |
| 1778 | comstart_first = SYNTAX_COMSTART_FIRST (c); | 1783 | comstart_first = SYNTAX_COMSTART_FIRST (c); |
| 1779 | comnested = SYNTAX_COMMENT_NESTED (c); | 1784 | comnested = SYNTAX_COMMENT_NESTED (c); |
| 1785 | comstyle = SYNTAX_COMMENT_STYLE (c); | ||
| 1780 | INC_BOTH (from, from_byte); | 1786 | INC_BOTH (from, from_byte); |
| 1781 | UPDATE_SYNTAX_TABLE_FORWARD (from); | 1787 | UPDATE_SYNTAX_TABLE_FORWARD (from); |
| 1782 | comstyle = 0; | ||
| 1783 | if (from < stop && comstart_first | 1788 | if (from < stop && comstart_first |
| 1784 | && (c1 = FETCH_CHAR (from_byte), | 1789 | && (c1 = FETCH_CHAR (from_byte), |
| 1785 | SYNTAX_COMSTART_SECOND (c1))) | 1790 | SYNTAX_COMSTART_SECOND (c1))) |
| @@ -1991,6 +1996,7 @@ scan_lists (from, count, depth, sexpflag) | |||
| 1991 | code = SYNTAX_WITH_MULTIBYTE_CHECK (c); | 1996 | code = SYNTAX_WITH_MULTIBYTE_CHECK (c); |
| 1992 | comstart_first = SYNTAX_COMSTART_FIRST (c); | 1997 | comstart_first = SYNTAX_COMSTART_FIRST (c); |
| 1993 | comnested = SYNTAX_COMMENT_NESTED (c); | 1998 | comnested = SYNTAX_COMMENT_NESTED (c); |
| 1999 | comstyle = SYNTAX_COMMENT_STYLE (c); | ||
| 1994 | prefix = SYNTAX_PREFIX (c); | 2000 | prefix = SYNTAX_PREFIX (c); |
| 1995 | if (depth == min_depth) | 2001 | if (depth == min_depth) |
| 1996 | last_good = from; | 2002 | last_good = from; |
| @@ -2171,7 +2177,7 @@ scan_lists (from, count, depth, sexpflag) | |||
| 2171 | } | 2177 | } |
| 2172 | 2178 | ||
| 2173 | /* Quoting turns anything except a comment-ender | 2179 | /* Quoting turns anything except a comment-ender |
| 2174 | into a word character. Note that this if cannot be true | 2180 | into a word character. Note that this cannot be true |
| 2175 | if we decremented FROM in the if-statement above. */ | 2181 | if we decremented FROM in the if-statement above. */ |
| 2176 | if (code != Sendcomment && char_quoted (from, from_byte)) | 2182 | if (code != Sendcomment && char_quoted (from, from_byte)) |
| 2177 | code = Sword; | 2183 | code = Sword; |
| @@ -2648,10 +2654,14 @@ do { prev_from = from; \ | |||
| 2648 | commentloop: | 2654 | commentloop: |
| 2649 | /* The (from == BEGV) test is to enter the loop in the middle so | 2655 | /* The (from == BEGV) test is to enter the loop in the middle so |
| 2650 | that we find a 2-char comment ender even if we start in the | 2656 | that we find a 2-char comment ender even if we start in the |
| 2651 | middle of it. */ | 2657 | middle of it. We don't want to do that if we're just at the |
| 2658 | beginning of the comment (think of (*) ... (*)). | ||
| 2659 | Actually, the current code still doesn't handle such cases right | ||
| 2660 | when the comment style allows nesting. */ | ||
| 2652 | found = forw_comment (from, from_byte, end, | 2661 | found = forw_comment (from, from_byte, end, |
| 2653 | state.incomment, state.comstyle, | 2662 | state.incomment, state.comstyle, |
| 2654 | (from == BEGV) ? 0 : prev_from_syntax, | 2663 | (from == BEGV || from < state.comstr_start + 3) |
| 2664 | ? 0 : prev_from_syntax, | ||
| 2655 | &out_charpos, &out_bytepos, &state.incomment); | 2665 | &out_charpos, &out_bytepos, &state.incomment); |
| 2656 | from = out_charpos; from_byte = out_bytepos; | 2666 | from = out_charpos; from_byte = out_bytepos; |
| 2657 | /* Beware! prev_from and friends are invalid now. | 2667 | /* Beware! prev_from and friends are invalid now. |