richter 01/05/04 07:05:09
Modified: . Tag: Embperl2c epcomp.c epdom.h epparse.c test.pl
Embperl/Syntax Tag: Embperl2c RTF.pm
test/html/rtf Tag: Embperl2c rtfbasic.asc
Log:
Embperl 2 - RTF syntax cont.
Revision Changes Path
No revision
No revision
1.4.2.49 +3 -3 embperl/Attic/epcomp.c
Index: epcomp.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epcomp.c,v
retrieving revision 1.4.2.48
retrieving revision 1.4.2.49
diff -u -r1.4.2.48 -r1.4.2.49
--- epcomp.c 2001/05/02 11:54:43 1.4.2.48
+++ epcomp.c 2001/05/04 14:04:19 1.4.2.49
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epcomp.c,v 1.4.2.48 2001/05/02 11:54:43 richter Exp $
+# $Id: epcomp.c,v 1.4.2.49 2001/05/04 14:04:19 richter Exp $
#
###################################################################################*/
@@ -888,9 +888,9 @@
{
char buf [32] ;
- if (pNode -> nLinenumber)
+ if (pNode -> nLinenumber && pNode -> nLinenumber != pDomTree ->
nLastLinenumber )
{
- int l2 = sprintf (buf, "#line %d \"", pNode -> nLinenumber) ;
+ int l2 = sprintf (buf, "#line %d \"", pDomTree -> nLastLinenumber =
pNode -> nLinenumber) ;
StringAdd (r -> pProg, buf, l2) ;
StringAdd (r -> pProg, sSourcefile, nSourcefile) ;
1.4.2.17 +2 -1 embperl/Attic/epdom.h
Index: epdom.h
===================================================================
RCS file: /home/cvs/embperl/Attic/epdom.h,v
retrieving revision 1.4.2.16
retrieving revision 1.4.2.17
diff -u -r1.4.2.16 -r1.4.2.17
--- epdom.h 2001/05/02 12:14:14 1.4.2.16
+++ epdom.h 2001/05/04 14:04:22 1.4.2.17
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epdom.h,v 1.4.2.16 2001/05/02 12:14:14 richter Exp $
+# $Id: epdom.h,v 1.4.2.17 2001/05/04 14:04:22 richter Exp $
#
###################################################################################*/
@@ -169,6 +169,7 @@
SV * pSV ; /* general purpose SV */
SV * pDomTreeSV ; /* SV that's hold the Index */
/* Domtree will be deleted when this SV is delted */
+ tUInt16 nLastLinenumber ;
} ;
typedef struct tDomTree tDomTree ;
1.4.2.22 +6 -3 embperl/Attic/epparse.c
Index: epparse.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epparse.c,v
retrieving revision 1.4.2.21
retrieving revision 1.4.2.22
diff -u -r1.4.2.21 -r1.4.2.22
--- epparse.c 2001/05/04 06:08:11 1.4.2.21
+++ epparse.c 2001/05/04 14:04:27 1.4.2.22
@@ -9,7 +9,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: epparse.c,v 1.4.2.21 2001/05/04 06:08:11 richter Exp $
+# $Id: epparse.c,v 1.4.2.22 2001/05/04 14:04:27 richter Exp $
#
###################################################################################*/
@@ -263,6 +263,7 @@
HV * pHash ;
struct tTokenTable * pNewTokenTable ;
char * sContains ;
+ char * sC ;
pKey = hv_iterkey (pEntry, &l) ;
pToken = hv_iterval (pTokenHash, pEntry) ;
@@ -309,7 +310,7 @@
p -> pStartTag = (struct tToken *)GetHashValueStrDup (pHash, "starttag",
NULL) ;
p -> pEndTag = (struct tToken *)GetHashValueStrDup (pHash, "endtag",
NULL) ;
p -> sParseTimePerlCode = GetHashValueStrDup (pHash, "parsetimeperlcode",
NULL) ;
- if (sContains = GetHashValueStrDup (pHash, "contains", NULL))
+ if (sC = sContains = GetHashValueStrDup (pHash, "contains", NULL))
{
unsigned char * pC ;
if ((p -> pContains = parse_malloc (r, sizeof (tCharMap))) == NULL)
@@ -320,6 +321,8 @@
while (*sContains)
{
pC[*sContains >> 3] |= 1 << (*sContains & 7) ;
+ pStartChars [*sContains >> 3] |= 1 << (*sContains & 7) ;
+ pStartChars [*sContains >> 3] |= 1 << (*sContains & 7) ;
sContains++ ;
}
}
@@ -339,7 +342,7 @@
if (r -> bDebug & dbgBuildToken)
- lprintf (r, "[%d]TOKEN: %*c%s ... %s unesc=%d nodetype=%d,
cdatatype=%d, nodename=%s\n", r -> nPid, nLevel*2, ' ', p -> sText, p ->
pContains?sContains:p -> sEndText, p -> bUnescape, p -> nNodeType, p -> nCDataType, p
-> sNodeName?p -> sNodeName:"<null>") ;
+ lprintf (r, "[%d]TOKEN: %*c%s ... %s unesc=%d nodetype=%d,
cdatatype=%d, nodename=%s contains='%s'\n", r -> nPid, nLevel*2, ' ', p -> sText, p ->
pContains?sContains:p -> sEndText, p -> bUnescape, p -> nNodeType, p -> nCDataType, p
-> sNodeName?p -> sNodeName:"<null>", sC?sC:"") ;
if (p -> sNodeName)
p -> nNodeName = String2Ndx (p -> sNodeName, strlen (p -> sNodeName)) ;
1.70.4.53 +5 -5 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.70.4.52
retrieving revision 1.70.4.53
diff -u -r1.70.4.52 -r1.70.4.53
--- test.pl 2001/05/04 06:08:12 1.70.4.52
+++ test.pl 2001/05/04 14:04:31 1.70.4.53
@@ -11,7 +11,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test.pl,v 1.70.4.52 2001/05/04 06:08:12 richter Exp $
+# $Id: test.pl,v 1.70.4.53 2001/05/04 14:04:31 richter Exp $
#
###################################################################################
@@ -573,10 +573,10 @@
'version' => 2,
'repeat' => 2,
},
-# 'rtf/rtfbasic.asc' => {
-# 'version' => 2,
-# 'syntax' => 'RTF',
-# },
+ 'rtf/rtfbasic.asc' => {
+ 'version' => 2,
+ 'syntax' => 'RTF',
+ },
) ;
for ($i = 0 ; $i < @testdata; $i += 2)
No revision
No revision
1.1.2.4 +77 -10 embperl/Embperl/Syntax/Attic/RTF.pm
Index: RTF.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/RTF.pm,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- RTF.pm 2001/05/02 19:12:53 1.1.2.3
+++ RTF.pm 2001/05/04 14:04:49 1.1.2.4
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: RTF.pm,v 1.1.2.3 2001/05/02 19:12:53 richter Exp $
+# $Id: RTF.pm,v 1.1.2.4 2001/05/04 14:04:49 richter Exp $
#
###################################################################################
@@ -22,7 +22,7 @@
use HTML::Embperl::Syntax::EmbperlBlocks ;
use strict ;
-use vars qw{@ISA %Block %FieldStart %CmdStart} ;
+use vars qw{@ISA %Block %FieldStart %CmdStart %Varinside %Varseparator %Var
%VarComment} ;
@@ -189,14 +189,15 @@
}) ;
$self -> AddRTFCmd ('DOCVARIABLE',
{
- perlcode =>
- [
- '_ep_rp(%$x%,scalar(%&<noname>%));',
- ],
- removenode => 4,
- compilechilds => 0,
-
- }) ;
+ perlcode => '_ep_rp(%$x%,scalar(',
+ perlcodeend => '));',
+ },
+ {
+ 'removenode' => 4,
+ 'inside' => \%Var,
+ 'cdatatype' => 0,
+ }
+ ) ;
$self -> AddRTFCmd ('MERGEFIELD',
{
perlcode =>
@@ -281,6 +282,72 @@
switchcodetype => 1,
}) ;
}
+
+
+%Varinside = (
+ '-lsearch' => 1,
+ 'Value' =>
+ {
+ 'contains' =>
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789',
+ #'inside' => \%Varseparator,
+ 'nodetype' => ntypTag,
+ 'nodename' => 'part_of_var',
+ 'cdatatype' => ntypTag,
+ 'procinfo' => {
+ 'embperl' => {
+ perlcode => '{%#0%}',
+ },
+ },
+ },
+ ) ;
+
+
+%Varseparator = (
+ '-lsearch' => 1,
+ 'Varname' =>
+ {
+ 'text' => '.',
+ 'nodename' => 'varpart',
+ 'nodetype' => ntypTag,
+ 'follow' => \%Varinside,
+ 'procinfo' => {
+ 'embperl' => {
+ perlcode => '{%#0%}',
+ compilechilds => 0,
+ },
+ },
+ }
+ ) ;
+
+
+
+%Var = (
+ '-lsearch' => 1,
+ 'Varname' =>
+ {
+ 'contains' =>
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789.',
+ #'inside' => \%Varseparator,
+ 'inside' => \%Varinside,
+ 'cdatatype' => 0,
+ 'nodename' => 'full_var',
+ 'procinfo' => {
+ 'embperl' => {
+ perlcode => '$param[0]',
+ },
+ },
+
+ }
+ ) ;
+
+
+%VarComment = (
+ '-lsearch' => 1,
+ 'VarnameComment' =>
+ {
+ text => '//*',
+ 'cdatatype' => 0,
+ }
+ ) ;
No revision
No revision
1.1.2.3 +4 -0 embperl/test/html/rtf/Attic/rtfbasic.asc
Index: rtfbasic.asc
===================================================================
RCS file: /home/cvs/embperl/test/html/rtf/Attic/rtfbasic.asc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- rtfbasic.asc 2001/05/02 19:12:59 1.1.2.2
+++ rtfbasic.asc 2001/05/04 14:05:00 1.1.2.3
@@ -1,2 +1,6 @@
+{Param[0]: }{\field{\*\fldinst { DOCVARIABLE abc \\* MERGEFORMAT }}{\fldrslt }}
+{Param[0]: }{\field{\*\fldinst { DOCVARIABLE a.b.c \\* MERGEFORMAT }}{\fldrslt }}
+{Param[1]: }{\field{\*\fldinst { DOCVARIABLE a.1.c }}{\fldrslt }}
+
{Param[0]: }{\field{\*\fldinst { DOCVARIABLE $param[0] \\* MERGEFORMAT }}{\fldrslt
}}
{Param[1]: }{\field{\*\fldinst { DOCVARIABLE $param[1] }}{\fldrslt }}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]