On Tue, Jan 21, 2003 at 07:44:59PM +0100, Emiliano wrote:

> Adding multi-dimension wouldn't be all that hard. The attached patch
> (not even compiled, I'll leave it as an exercise for the reader how much
> testing this has seen) should enable it.

That'll go to show me. Fixed patch attached.

Emile
Index: preparse.l
===================================================================
RCS file: /home/cvsmgd/midgard/lib/src/preparse.l,v
retrieving revision 1.19
diff -u -r1.19 preparse.l
--- preparse.l  17 May 2002 15:00:52 -0000      1.19
+++ preparse.l  21 Jan 2003 18:42:36 -0000
@@ -122,7 +122,9 @@
 MIDGARD_ARRINDEX ({MIDGARD_VARPART}|[0-9]+|{dqstring}|{qstring})
 MIDGARD_VARSPEC_ATTR ((("."|"->"){MIDGARD_VARPART})|("["{MIDGARD_ARRINDEX}"]"))
 MIDGARD_VARSPEC_FMT ":"{MIDGARD_FMTSPEC}
-MIDGARD_VARSPEC {MIDGARD_VARPART}{MIDGARD_VARSPEC_ATTR}?{MIDGARD_VARSPEC_FMT}?
+
+MIDGARD_FMTEXPR ([^()]*("("[^()]+")")*)*
+MIDGARD_VARSPEC {MIDGARD_FMTEXPR}{MIDGARD_VARSPEC_FMT}?
 
 %%
 
@@ -160,13 +162,14 @@
 #if MIDGARD_PARSER_DEBUG
    mgd_parser_log_other(); fprintf(stderr, "MidgardParser: varformat &(%s);\n", 
mgdlibtext);
 #endif
-   if ((fmt = strchr(mgdlibtext, ':')) != NULL) {
+   if ((fmt = strrchr(mgdlibtext, ':')) != NULL) {
       *fmt = '\0';
       fmt++;
    } else {
       fmt = "";
    }
 
+#if KEEP_DOT_SYNTAX
    if ((attr = strchr(mgdlibtext, '.')) != NULL) {
       *attr = '\0';
       attr++;
@@ -202,7 +205,9 @@
       mgd_parser_output_const(" }");
 #endif
       mgd_parser_output_const(" ?>");
-   } else {
+   } else
+#endif
+   {
       mgd_parser_output_const("<?php ");
 
       mgd_fmt_start(fmt);

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to