[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xwpe Basic



> Any idea where/how to fix it so that the syntax recognition will allow a
> definition for "comment from here to end of line" that is made of
> ordinary characters?
> I looked, came up dry, but then I'm not a programmer.

One patch comming up.

Dennis Payne
dulsi@identicalsoftware.com

--- we_progn.c.orig	Tue Sep  7 23:48:21 1999
+++ we_progn.c	Wed Sep  8 22:08:36 1999
@@ -90,35 +90,55 @@
         {  if(cs->insensitive && (n == 0 				\
 			|| (!isalnum(str[n-1]) && str[n-1] != '_')))	\
 	   {  int ii, jj;						\
-	      for(ii = 0; cs->reserved_word[ii] 			\
+              int kk = strlen(cs->line_comment);			\
+              if ((WpeStrnccmp(cs->line_comment, str + n, kk) == 0) &&	\
+                (!isalnum(str[n +kk])) && (str[n + kk] != '_'))		\
+              {		    						\
+               mcsw = 7;						\
+               frb = FRB4;						\
+              }		 						\
+              else							\
+              {								\
+                for(ii = 0; cs->reserved_word[ii] 			\
 			&& cs->reserved_word[ii][0] < toupper(str[n]);  \
                         ii++); 						\
-	      for( ; cs->reserved_word[ii]				\
+	        for( ; cs->reserved_word[ii]				\
 			&& cs->reserved_word[ii][0] == toupper(str[n]); \
                         ii++)						\
-	      {  for(jj = 0; cs->reserved_word[ii][jj]			\
-		   && cs->reserved_word[ii][jj] == toupper(str[n+jj]);  \
-                   jj++);						\
-	           if(!cs->reserved_word[ii][jj] && !isalnum(str[n+jj]) \
+	        {  for(jj = 0; cs->reserved_word[ii][jj]		\
+		     && cs->reserved_word[ii][jj] == toupper(str[n+jj]);\
+                     jj++);						\
+                   if(!cs->reserved_word[ii][jj] && !isalnum(str[n+jj]) \
 			&& str[n+jj] != '_')				\
 	           {  mcsw = 6;  frb = FRB1;  break;  }			\
+                }	    						\
 	      }								\
 	   }								\
 	   else if(!cs->insensitive && (n == 0 				\
 			|| (!isalnum(str[n-1]) && str[n-1] != '_')))	\
 	   {  int ii, jj;						\
-	      for(ii = 0; cs->reserved_word[ii] 			\
+              int kk = strlen(cs->line_comment);			\
+              if ((strncmp(cs->line_comment, str + n, kk) == 0) &&	\
+                (!isalnum(str[n +kk])) && (str[n + kk] != '_'))		\
+              {		    						\
+               mcsw = 7;						\
+               frb = FRB4;						\
+              }		 						\
+              else							\
+              {								\
+	        for(ii = 0; cs->reserved_word[ii] 			\
 			&& cs->reserved_word[ii][0] < str[n]; ii++);	\
-	      for( ; cs->reserved_word[ii] 				\
+	        for( ; cs->reserved_word[ii] 				\
 			&& cs->reserved_word[ii][0] == str[n]; ii++)	\
-	      {  for(jj = 0; cs->reserved_word[ii][jj]			\
-		   && cs->reserved_word[ii][jj] == str[n+jj]; jj++);	\
-	           if(!cs->reserved_word[ii][jj] && !isalnum(str[n+jj]) \
+	        {  for(jj = 0; cs->reserved_word[ii][jj]		\
+		     && cs->reserved_word[ii][jj] == str[n+jj]; jj++);	\
+                   if(!cs->reserved_word[ii][jj] && !isalnum(str[n+jj]) \
 			&& str[n+jj] != '_')				\
 	           {  mcsw = 6;  frb = FRB1;  break;  }			\
+                }	    						\
 	      }								\
 	   }								\
-	   if(!mcsw) frb = FRB5;					\
+	   if (!mcsw) frb = FRB5;					\
 	}								\
 	else if(isspace(str[n]))					\
 	{  mcsw = 0;  frb = FRB5;  }					\