richter 01/03/07 06:24:00
Modified: . Tag: Embperl2c Embperl.pm Syntax.xs epparse.c
test.pl
Embperl/Syntax Tag: Embperl2c EmbperlBlocks.pm HTML.pm
SSI.pm
test/cmp2 Tag: Embperl2c error.htm
test/conf Tag: Embperl2c httpd.conf.src
test/html Tag: Embperl2c input.htm
Log:
Embperl 2 - multiple syntaxes
Revision Changes Path
No revision
No revision
1.118.4.25 +5 -3 embperl/Embperl.pm
Index: Embperl.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl.pm,v
retrieving revision 1.118.4.24
retrieving revision 1.118.4.25
diff -u -r1.118.4.24 -r1.118.4.25
--- Embperl.pm 2001/03/07 08:18:25 1.118.4.24
+++ Embperl.pm 2001/03/07 14:23:39 1.118.4.25
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: Embperl.pm,v 1.118.4.24 2001/03/07 08:18:25 richter Exp $
+# $Id: Embperl.pm,v 1.118.4.25 2001/03/07 14:23:39 richter Exp $
#
###################################################################################
@@ -1984,7 +1984,8 @@
foreach $err (@$errors)
{
$self -> output ("<A HREF=\"$virtlog?$logfilepos&$$#E$cnt\">") ;
#<tt>") ;
- $HTML::Embperl::escmode = 7 ;
+ $HTML::Embperl::escmode = 3 ;
+ $err =~ s|\\|\\\\|g;
$err =~ s|\n|\n\\<br\\>\\ \\ \\ \\ |g;
$err =~ s|(Line [0-9]*:)|$1\\</a\\>|;
$self -> output ($err) ;
@@ -1996,9 +1997,10 @@
}
else
{
- $HTML::Embperl::escmode = 7 ;
+ $HTML::Embperl::escmode = 3 ;
foreach $err (@$errors)
{
+ $err =~ s|\\|\\\\|g;
$err =~ s|\n|\n\\<br\\>\\ \\ \\ \\ |g;
$self -> output ("$err\\<p\\>\r\n") ;
#$self -> output ("\\<tt\\>$err\\</tt\\>\\<p\\>\r\n") ;
1.1.2.4 +4 -2 embperl/Attic/Syntax.xs
Index: Syntax.xs
===================================================================
RCS file: /home/cvs/embperl/Attic/Syntax.xs,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Syntax.xs 2001/03/07 08:18:25 1.1.2.3
+++ Syntax.xs 2001/03/07 14:23:41 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: Syntax.xs,v 1.1.2.3 2001/03/07 08:18:25 richter Exp $
+# $Id: Syntax.xs,v 1.1.2.4 2001/03/07 14:23:41 richter Exp $
#
###################################################################################
@@ -27,6 +27,7 @@
tTokenTable * pTab ;
HV * pHV ;
SV ** ppSV ;
+ int rc ;
if (!SvROK (pSyntaxObj) || SvTYPE(pHV = (HV *)SvRV(pSyntaxObj)) != SVt_PVHV ||
(mg = mg_find ((SV *)pHV, '~')))
{
@@ -43,5 +44,6 @@
if (ppSV == NULL || *ppSV == NULL || !SvROK (*ppSV))
croak ("Internal Error: pSyntaxObj has no -root") ;
else
- BuildTokenTable (pCurrReq, (HV *)(SvRV(*ppSV)), "", NULL, pTab) ;
+ if ((rc = BuildTokenTable (pCurrReq, (HV *)(SvRV(*ppSV)), "", NULL, pTab)) !=
ok)
+ LogError (pCurrReq, rc) ;
1.4.2.11 +1 -1 embperl/Attic/epparse.c
Index: epparse.c
===================================================================
RCS file: /home/cvs/embperl/Attic/epparse.c,v
retrieving revision 1.4.2.10
retrieving revision 1.4.2.11
diff -u -r1.4.2.10 -r1.4.2.11
--- epparse.c 2001/03/07 08:18:26 1.4.2.10
+++ epparse.c 2001/03/07 14:23:42 1.4.2.11
@@ -222,7 +222,7 @@
int i ;
unsigned char * pStartChars = pTokenTable -> cStartChars ;
unsigned char * pAllChars = pTokenTable -> cAllChars ;
-
+
memset (pStartChars, 0, sizeof (pTokenTable -> cStartChars)) ;
memset (pAllChars, 0, sizeof (pTokenTable -> cAllChars)) ;
pTokenTable -> bLSearch = 0 ;
1.70.4.29 +11 -4 embperl/test.pl
Index: test.pl
===================================================================
RCS file: /home/cvs/embperl/test.pl,v
retrieving revision 1.70.4.28
retrieving revision 1.70.4.29
diff -u -r1.70.4.28 -r1.70.4.29
--- test.pl 2001/03/06 12:33:39 1.70.4.28
+++ test.pl 2001/03/07 14:23:43 1.70.4.29
@@ -25,7 +25,7 @@
},
'error.htm' => {
'repeat' => 3,
- 'errors' => 7,
+ 'errors' => 6,
'version' => 2,
},
'errormismatch.htm' => {
@@ -59,7 +59,7 @@
},
'errdoc/errdoc.htm' => {
'option' => '262144',
- 'errors' => 7,
+ 'errors' => 6,
'version' => 2,
'cgi' => 0,
},
@@ -72,7 +72,7 @@
},
'errdoc/epl/errdoc2.htm' => {
'option' => '262144',
- 'errors' => 7,
+ 'errors' => 6,
'version' => 2,
'cgi' => 0,
},
@@ -463,6 +463,10 @@
'offline' => 0,
'cgi' => 0,
},
+ 'SSI/ssibasic.htm' => {
+ 'version' => 2,
+ 'syntax' => 'SSI',
+ },
) ;
for ($i = 0 ; $i < @testdata; $i += 2)
@@ -521,7 +525,7 @@
print "\nloading... ";
- $defaultdebug = 0x7f85ffd ;
+ $defaultdebug = 0x7fc5ffd ;
#$defaultdebug = 1 ;
#### setup paths #####
@@ -1124,6 +1128,8 @@
$ENV{EMBPERL_ALLOW} = 'asc|\\.htm$|\\.htm-1$' ;
+HTML::Embperl::log ("Start testing...\n") ; # force logfile open
+
do
{
if ($opt_offline || $opt_execute || $opt_cache)
@@ -1182,6 +1188,7 @@
delete $ENV{EMBPERL_OPTIONS} if (defined ($ENV{EMBPERL_OPTIONS})) ;
$ENV{EMBPERL_OPTIONS} = $test -> {option} if (defined ($test ->
{option})) ;
+ $ENV{EMBPERL_SYNTAX} = $test -> {syntax} if (defined ($test ->
{syntax})) ;
$ENV{EMBPERL_COMPARTMENT} = $test -> {compartment} if (defined ($test
-> {compartment})) ;
@testargs = ( '-o', $outfile ,
'-l', $logfile,
No revision
No revision
1.1.2.7 +14 -2 embperl/Embperl/Syntax/Attic/EmbperlBlocks.pm
Index: EmbperlBlocks.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/EmbperlBlocks.pm,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- EmbperlBlocks.pm 2001/03/07 08:18:30 1.1.2.6
+++ EmbperlBlocks.pm 2001/03/07 14:23:48 1.1.2.7
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: EmbperlBlocks.pm,v 1.1.2.6 2001/03/07 08:18:30 richter Exp $
+# $Id: EmbperlBlocks.pm,v 1.1.2.7 2001/03/07 14:23:48 richter Exp $
#
###################################################################################
@@ -76,7 +76,7 @@
my $tagtype = 'Embperl meta command' ;
my $ttref ;
- die "'$tagtype' unknown" if (!($ttref = $self -> {-root}{$tagtype})) ;
+ die "'$tagtype' unknown" if (!($ttref = $self -> {-epbBlocks}{$tagtype})) ;
my $ttfollow = ($ttref -> {'follow'} ||= {}) ;
my $tag = $ttfollow -> {$cmdname} = {
@@ -85,6 +85,18 @@
'cdatatype' => ntypAttrValue,
'forcetype' => 1,
'unescape' => 1,
+ } ;
+ $tag -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo } if ($procinfo)
;
+
+ die "'$tagtype' unknown" if (!($ttref = $self -> {-epbBlocksLink}{$tagtype})) ;
+ $ttfollow = ($ttref -> {'follow'} ||= {}) ;
+
+ my $tag2 = $ttfollow -> {$cmdname} = {
+ 'text' => $cmdname,
+ 'nodetype' => ntypTag,
+ 'cdatatype' => ntypAttrValue,
+ 'forcetype' => 1,
+ 'unescape' => 2,
} ;
$tag -> {'procinfo'} = { $self -> {-procinfotype} => $procinfo } if ($procinfo)
;
1.1.2.7 +23 -18 embperl/Embperl/Syntax/Attic/HTML.pm
Index: HTML.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/HTML.pm,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- HTML.pm 2001/03/07 08:18:30 1.1.2.6
+++ HTML.pm 2001/03/07 14:23:49 1.1.2.7
@@ -10,7 +10,7 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: HTML.pm,v 1.1.2.6 2001/03/07 08:18:30 richter Exp $
+# $Id: HTML.pm,v 1.1.2.7 2001/03/07 14:23:49 richter Exp $
#
###################################################################################
@@ -50,19 +50,6 @@
if ($firsttime)
{
- $self -> AddToRoot (
- {
- 'HTML Tag' => {
- 'text' => '<',
- 'end' => '>',
- },
- 'HTML Comment' => {
- 'text' => '<!--',
- 'nodename' => '!--',
- 'end' => '-->',
- },
- }) ;
-
$self -> {-htmlAssignAttr} = $self -> CloneHash (\%AssignAttr) ;
$self -> {-htmlAssignAttrLink} = $self -> CloneHash (\%AssignAttr) ;
}
@@ -101,7 +88,7 @@
my $assignattr = $self -> {-htmlAssignAttr} ;
foreach (@$attrs)
{
- $inside {$_} = { 'text' => $_, 'nodename' => $_, follow =>
$assignattr },
+ $inside {$_} = { 'text' => $_, 'nodename' => $_, 'follow' =>
$assignattr },
$addinside++ ;
}
}
@@ -110,15 +97,15 @@
my $assignattr = $self -> {-htmlAssignAttrLink} ;
foreach (@$attrsurl)
{
- $inside {$_} = { 'text' => $_, 'nodename' => $_, follow =>
$assignattr },
+ $inside {$_} = { 'text' => $_, 'nodename' => $_, 'follow' =>
$assignattr },
$addinside++ ;
}
}
if ($attrsnoval)
{
- foreach (@$attrs)
+ foreach (@$attrsnoval)
{
- $inside {$_} = { 'text' => $_, 'nodename' => $_},
+ $inside {$_} = { 'text' => $_, , 'nodetype' => ntypAttr, },
$addinside++ ;
}
}
@@ -139,6 +126,15 @@
{
my $self = shift ;
+
+ $self -> AddToRoot ({
+ 'HTML Tag' => {
+ 'text' => '<',
+ 'end' => '>',
+ }
+ }) if (!exists $self -> {-root}{'HTML Tag'}) ;
+
+
$self -> AddElement ('HTML Tag', @_) ;
}
@@ -155,6 +151,15 @@
{
my $self = shift ;
+
+ $self -> AddToRoot (
+ {
+ 'HTML Comment' => {
+ 'text' => '<!--',
+ 'end' => '-->',
+ }
+ }) if (!exists $self -> {-root}{'HTML Comment'}) ;
+
$self -> AddElement ('HTML Comment', @_) ;
}
1.1.2.3 +68 -35 embperl/Embperl/Syntax/Attic/SSI.pm
Index: SSI.pm
===================================================================
RCS file: /home/cvs/embperl/Embperl/Syntax/Attic/SSI.pm,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- SSI.pm 2001/02/23 19:40:28 1.1.2.2
+++ SSI.pm 2001/03/07 14:23:50 1.1.2.3
@@ -10,59 +10,92 @@
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: SSI.pm,v 1.1.2.2 2001/02/23 19:40:28 richter Exp $
+# $Id: SSI.pm,v 1.1.2.3 2001/03/07 14:23:50 richter Exp $
#
###################################################################################
+package HTML::Embperl::Syntax::SSI ;
+use HTML::Embperl::Syntax qw{:types} ;
+use HTML::Embperl::Syntax::HTML ;
-package HTML::Embperl::Syntax::SSI ;
+use strict ;
+use vars qw{@ISA} ;
-@ISA = (HTML::Embperl::Syntax::HTML) ;
+@ISA = qw(HTML::Embperl::Syntax::HTML) ;
+###################################################################################
+#
+# Methods
+#
+###################################################################################
+# ---------------------------------------------------------------------------------
+#
+# Create new Syntax Object
+#
+# ---------------------------------------------------------------------------------
+
+
sub new
{
- my $package = shift ;
+ my $class = shift ;
- my $self = SUPER::new ;
+ my $self = HTML::Embperl::Syntax::HTML::new ($class) ;
- bless $self, 'HTML::Embperl::Syntax::SSI' ;
+ Init ($self) ;
+ return $self ;
+ }
- $self -> AddSimpleTag ('HTML Comment', 'echo', ['var', 'encoding'], { perlcode
=> '_ep_rp(%$n%, $ENV{%&*\'var%}) ;' } ) ;
- $self -> AddSimpleTag ('HTML Comment', 'config', ['errmsg', 'sizefmt',
'timefmt'],
- { perlcode => [
- '$_ep_ssi_errmsg =
%&*\'errmsg% ;',
- '$_ep_ssi_sizefmt =
%&*\'siezfmt% ;',
- '$_ep_ssi_timefmt =
%&*\'timefmt% ;',
- ] } ) ;
-
- $self -> AddSimpleTag ('HTML Comment', 'exec', ['cgi', 'cmd'],
- { perlcode => [
- 'open (FH,
%&*\'cmd% . '|') or die "Cannot open %&*cmd% ($!)" ; { local $\= undef ; _ep_rp(%$n%,
<FH>) ; close FH ; }',
- ] } ) ;
-
- $self -> AddSimpleTag ('HTML Comment', 'fsize', ['file', 'virtual'],
- { perlcode => [
- '_ep_rp(%$n%, -s
%&*\'file%) ;',
- '_ep_rp(%$n%, -s
virt2file (%&*\'virtual%)) ;',
- ] } ) ;
- $self -> AddSimpleTag ('HTML Comment', 'flastmod', ['file', 'virtual'],
- { perlcode => [
- '_ep_rp(%$n%, -m
%&*\'file%) ;',
- '_ep_rp(%$n%, -m
virt2file (%&*\'virtual%)) ;',
- ] } ) ;
-
- $self -> AddSimpleTag ('HTML Comment', 'set', ['var', 'value'],
- { perlcode =>
'$ENV{%&*\'var%} = %&\'value% ;',
- removenode => 1
- } ) ;
- return $self ;
+
+###################################################################################
+#
+# Definitions for Embperl HTML tags
+#
+###################################################################################
+
+sub Init
+
+ {
+ my ($self) = @_ ;
+
+
+
+ $self -> AddComment ('#echo', ['var', 'encoding'], undef, undef, { perlcode =>
'_ep_rp(%$x%, $ENV{%&*\'var%}) ;' } ) ;
+ $self -> AddComment ('#config', ['errmsg', 'sizefmt', 'timefmt'], undef, undef,
+ { perlcode => [
+ '$_ep_ssi_errmsg = %&*\'errmsg% ;',
+ '$_ep_ssi_sizefmt = %&*\'siezfmt% ;',
+ '$_ep_ssi_timefmt = %&*\'timefmt% ;',
+ ] } ) ;
+
+ $self -> AddComment ('#exec', ['cgi', 'cmd'], undef, undef,
+ { perlcode => [
+ 'open (FH, %&*\'cmd% . '|') or die "Cannot
open %&*cmd% ($!)" ; { local $\= undef ; _ep_rp(%$x%, <FH>) ; close FH ; }',
+ ] } ) ;
+
+ $self -> AddComment ('#fsize', ['file', 'virtual'], undef, undef,
+ { perlcode => [
+ '_ep_rp(%$x%, -s %&*\'file%) ;',
+ '_ep_rp(%$x%, -s virt2file (%&*\'virtual%))
;',
+ ] } ) ;
+ $self -> AddComment ('#flastmod', ['file', 'virtual'], undef, undef,
+ { perlcode => [
+ '_ep_rp(%$x%, -m %&*\'file%) ;',
+ '_ep_rp(%$x%, -m virt2file (%&*\'virtual%))
;',
+ ] } ) ;
+
+ $self -> AddComment ('#set', ['var', 'value'], undef, undef,
+ { perlcode => '$ENV{%&*\'var%} = %&\'value% ;',
+ removenode => 1
+ } ) ;
}
+
+1 ;
No revision
No revision
1.1.2.4 +2 -1 embperl/test/cmp2/Attic/error.htm
Index: error.htm
===================================================================
RCS file: /home/cvs/embperl/test/cmp2/Attic/error.htm,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- error.htm 2000/12/18 11:38:36 1.1.2.3
+++ error.htm 2001/03/07 14:23:54 1.1.2.4
@@ -10,8 +10,9 @@
^<br> syntax error at .*?error.htm line \d+,
^<br> syntax error at .*?error.htm line \d+, near
"\$error is here "
^<br> syntax error at .*?error.htm line \d+, near "
+^<br>
+^<br>
^<br> }
-^<br> _ep_cp"
^\[.*?\]ERR: 24: Line \d+: Error in Perl code: <p>
^ HTML\:\:Embperl.*?<P>
</BODY></HTML>
No revision
No revision
1.24.4.9 +5 -0 embperl/test/conf/httpd.conf.src
Index: httpd.conf.src
===================================================================
RCS file: /home/cvs/embperl/test/conf/httpd.conf.src,v
retrieving revision 1.24.4.8
retrieving revision 1.24.4.9
diff -u -r1.24.4.8 -r1.24.4.9
--- httpd.conf.src 2001/02/23 19:40:30 1.24.4.8
+++ httpd.conf.src 2001/03/07 14:23:56 1.24.4.9
@@ -358,6 +358,11 @@
</Location>
+<Location /SSI>
+PerlSetEnv EMBPERL_SYNTAX SSI
+</Location>
+
+
<Location /eg>
SetHandler perl-script
PerlHandler HTML::Embperl
No revision
No revision
1.10.4.5 +0 -10 embperl/test/html/input.htm
Index: input.htm
===================================================================
RCS file: /home/cvs/embperl/test/html/input.htm,v
retrieving revision 1.10.4.4
retrieving revision 1.10.4.5
diff -u -r1.10.4.4 -r1.10.4.5
--- input.htm 2001/03/07 08:18:31 1.10.4.4
+++ input.htm 2001/03/07 14:23:59 1.10.4.5
@@ -1,13 +1,3 @@
-<input name="feld1">
-<input name=feld1>
-<input name='feld1'>
-<input src='feld1[+ ' bla'+]'>
-
-<!-- Die ist ein Kommentar -->
-
-
-
-
<html>
<head>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]