changeset 3794:ea9d3f2cd5fa

(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.
author Richard M. Stallman <rms@gnu.org>
date Thu, 17 Jun 1993 04:09:15 +0000
parents 374fc1ccdc3f
children d59af8c9bc65
files src/syntax.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c	Thu Jun 17 02:59:54 1993 +0000
+++ b/src/syntax.c	Thu Jun 17 04:09:15 1993 +0000
@@ -684,6 +684,7 @@
 
 	  if (code == Sendcomment && !quoted)
 	    {
+#if 0
 	      if (code != SYNTAX (c))
 		/* For a two-char comment ender, we can assume
 		   it does end a comment.  So scan back in a simple way.  */
@@ -709,6 +710,7 @@
 		    }
 		  break;
 		}
+#endif /* 0 */
 
 	      /* Look back, counting the parity of string-quotes,
 		 and recording the comment-starters seen.
@@ -1076,6 +1078,7 @@
 	    case Sendcomment:
 	      if (!parse_sexp_ignore_comments)
 		break;
+#if 0
 	      if (code != SYNTAX (c))
 		/* For a two-char comment ender, we can assume
 		   it does end a comment.  So scan back in a simple way.  */
@@ -1096,6 +1099,7 @@
 		    }
 		  break;
 		}
+#endif /* 0 */
 
 	      /* Look back, counting the parity of string-quotes,
 		 and recording the comment-starters seen.
@@ -1410,14 +1414,18 @@
     {
       code = SYNTAX (FETCH_CHAR (from));
       from++;
-      if (from < end && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from - 1))
-	  && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from)))
+      if (code == Scomment)
+	state.comstart = from-1;
+      
+      else if (from < end && SYNTAX_COMSTART_FIRST (FETCH_CHAR (from - 1))
+	       && SYNTAX_COMSTART_SECOND (FETCH_CHAR (from)))
 	{
 	  /* Record the comment style we have entered so that only
 	     the comment-end sequence of the same style actually
 	     terminates the comment section.  */
 	  code = Scomment;
 	  state.comstyle = SYNTAX_COMMENT_STYLE (FETCH_CHAR (from));
+	  state.comstart = from-1;
 	  from++;
 	}
 
@@ -1471,7 +1479,6 @@
 
 	case Scomment:
 	  state.incomment = 1;
-	  state.comstart = from;
 	startincomment:
 	  if (commentstop)
 	    goto done;