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

Re: COST & Tcl 8.0



On 03 Feb 1998 16:50:19 +0300, Alex Kicelew wrote:

> Boris Tobotras <tobotras@jet.msk.su> writes:
> 
> > > а обрабатывать комментарии ты его не научил? :)
> > 	Какие комментарии должен обрабатывать CoST? :)
> 
>     {element "author"} {
> 	# очень умная мысль
> 	prefix {\n\\setcounter{page}{-1}\n\
> 		\\centerline\{\\Large\\bf{}}
> 	suffix {\}\n\n\\vfill\n}
>     }
> 
> на # он мрет.

	Дык. Что ж ты раньше не сказал, что оно тебе надо? :)

	Аттачу свой патч против дистрибутивного cost-2.0a3. 

	Кстати :) Колись, что за спецификация вверху процитирована :)

diff -u -r -N cost-2.0a3/src/assoc.c cost-my/src/assoc.c
--- cost-2.0a3/src/assoc.c	Fri Sep  1 03:26:38 1995
+++ cost-my/src/assoc.c	Tue Feb  3 18:00:17 1998
@@ -99,6 +99,38 @@
 	if (!a->query)
 		goto err;
 
+	/* Now nuke possible comments.
+	 *
+	 * Comment should start with a '#' and last to the end of line.
+	 * Entire line is killed.
+	 *
+	 * Comments are only recognized before first association, because
+	 * '#' sign well might represent something meaningful in output
+	 * language. 
+	 *
+	 * Comments are only recognized on consequitive sequence of line.
+	 * First non-comment line terminates comment sequence.
+	 *
+	 * [BT]
+	 */
+	{
+		char *p = assocpairs[ i + 1 ];
+		while ( 1 ) {
+			if ( *p == '\n' ) {
+				while ( *p && isspace( *p ) )
+					++p;
+				if ( *p == '\0' )
+					break;
+				if ( *p == '#' ) {
+					for ( p[ -1 ] = ' '; *p && *p != '\n'; ++p )
+						*p = ' ';
+					if ( !*p )
+						break;
+				} else
+					break;
+			}
+ 		}
+	}
 	status = Tcl_SplitList(interp, assocpairs[i+1], &sublistlen, &sublist);
 	if (status == TCL_ERROR) goto err;
 
diff -u -r -N cost-2.0a3/src/tclAppInit.c cost-my/src/tclAppInit.c
--- cost-2.0a3/src/tclAppInit.c	Tue Jan 16 23:47:50 1996
+++ cost-my/src/tclAppInit.c	Tue Jan 27 13:57:39 1998
@@ -88,7 +88,6 @@
     if (Tcl_Eval(interp, "cost_commandline") != TCL_OK) return TCL_ERROR;
 #endif
 
-    tcl_RcFileName = 0;
     return TCL_OK;
 }
 
diff -u -r -N cost-2.0a3/src/tclcost.c cost-my/src/tclcost.c
--- cost-2.0a3/src/tclcost.c	Tue Jan 16 23:47:03 1996
+++ cost-my/src/tclcost.c	Tue Jan 27 13:57:39 1998
@@ -292,7 +292,7 @@
 	while (nd) 
 	{
 	    ESISNodeType ndtype = esis_nodetype(nd);
-	    if (ndtype == EN_CDATA || ndtype == EN_RE)
+	    if (ndtype == EN_CDATA || ndtype == EN_SDATA || ndtype == EN_RE)
 		Tcl_AppendResult(interp, esis_text(nd), NULL);
 	    nd = esis_nextpreorder(current_node, nd);
 	}
	Best regards, -- Boris.