diff options
| author | Richard M. Stallman | 1993-06-17 04:09:15 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-17 04:09:15 +0000 |
| commit | 8f9dc2ed1cdb0aa44cf7f57e17c1cd327db1b84f (patch) | |
| tree | da8d023beacc12035295c37d6c4fdfdee2893ffe /src | |
| parent | 2ad18bfd26db378472644078f7a473a2911b2f40 (diff) | |
| download | emacs-8f9dc2ed1cdb0aa44cf7f57e17c1cd327db1b84f.tar.gz emacs-8f9dc2ed1cdb0aa44cf7f57e17c1cd327db1b84f.zip | |
(scan_lists, Fforward_comment): #if 0 the code
to treat two-character comment enders with a special shortcut.
(scan_sexps_forward): Set state.comstart to before the
comment starter, not after.
Diffstat (limited to 'src')
| -rw-r--r-- | src/syntax.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/syntax.c b/src/syntax.c index 89e5f753ba5..67a14f8923c 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -684,6 +684,7 @@ between them, return t; otherwise return nil.") | |||
| 684 | 684 | ||
| 685 | if (code == Sendcomment && !quoted) | 685 | if (code == Sendcomment && !quoted) |
| 686 | { | 686 | { |
| 687 | #if 0 | ||
| 687 | if (code != SYNTAX (c)) | 688 | if (code != SYNTAX (c)) |
| 688 | /* For a two-char comment ender, we can assume | 689 | /* For a two-char comment ender, we can assume |
| 689 | it does end a comment. So scan back in a simple way. */ | 690 | it does end a comment. So scan back in a simple way. */ |
| @@ -709,6 +710,7 @@ between them, return t; otherwise return nil.") | |||
| 709 | } | 710 | } |
| 710 | break; | 711 | break; |
| 711 | } | 712 | } |
| 713 | #endif /* 0 */ | ||
| 712 | 714 | ||
| 713 | /* Look back, counting the parity of string-quotes, | 715 | /* Look back, counting the parity of string-quotes, |
| 714 | and recording the comment-starters seen. | 716 | and recording the comment-starters seen. |
| @@ -1076,6 +1078,7 @@ scan_lists (from, count, depth, sexpflag) | |||
| 1076 | case Sendcomment: | 1078 | case Sendcomment: |
| 1077 | if (!parse_sexp_ignore_comments) | 1079 | if (!parse_sexp_ignore_comments) |
| 1078 | break; | 1080 | break; |
| 1081 | #if 0 | ||
| 1079 | if (code != SYNTAX (c)) | 1082 | if (code != SYNTAX (c)) |
| 1080 | /* For a two-char comment ender, we can assume | 1083 | /* For a two-char comment ender, we can assume |
| 1081 | it does end a comment. So scan back in a simple way. */ | 1084 | it does end a comment. So scan back in a simple way. */ |
| @@ -1096,6 +1099,7 @@ scan_lists (from, count, depth, sexpflag) | |||
| 1096 | } | 1099 | } |
| 1097 | break; | 1100 | break; |
| 1098 | } | 1101 | } |
| 1102 | #endif /* 0 */ | ||
| 1099 | 1103 | ||
| 1100 | /* Look back, counting the parity of string-quotes, | 1104 | /* Look back, counting the parity of string-quotes, |
| 1101 | and recording the comment-starters seen. | 1105 | and recording the comment-starters seen. |
| @@ -1410,14 +1414,18 @@ scan_sexps_forward (stateptr, from, end, targetdepth, | |||
| 1410 | { | 1414 | { |
| 1411 | code = SYNTAX (FETCH_CHAR (from)); | 1415 | code = SYNTAX (FETCH_CHAR (from)); |
| 1412 | from++; | 1416 | from++; |
| 1413 | if (from < end && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from - 1)) | 1417 | if (code == Scomment) |
| 1414 | && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from))) | 1418 | state.comstart = from-1; |
| 1419 | |||
| 1420 | else if (from < end && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from - 1)) | ||
| 1421 | && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from))) | ||
| 1415 | { | 1422 | { |
| 1416 | /* Record the comment style we have entered so that only | 1423 | /* Record the comment style we have entered so that only |
| 1417 | the comment-end sequence of the same style actually | 1424 | the comment-end sequence of the same style actually |
| 1418 | terminates the comment section. */ | 1425 | terminates the comment section. */ |
| 1419 | code = Scomment; | 1426 | code = Scomment; |
| 1420 | state.comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from)); | 1427 | state.comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from)); |
| 1428 | state.comstart = from-1; | ||
| 1421 | from++; | 1429 | from++; |
| 1422 | } | 1430 | } |
| 1423 | 1431 | ||
| @@ -1471,7 +1479,6 @@ scan_sexps_forward (stateptr, from, end, targetdepth, | |||
| 1471 | 1479 | ||
| 1472 | case Scomment: | 1480 | case Scomment: |
| 1473 | state.incomment = 1; | 1481 | state.incomment = 1; |
| 1474 | state.comstart = from; | ||
| 1475 | startincomment: | 1482 | startincomment: |
| 1476 | if (commentstop) | 1483 | if (commentstop) |
| 1477 | goto done; | 1484 | goto done; |