[TxMt] Recursive parsing?

Andreas Pardeike ap at fsys.se
Wed Apr 8 08:42:37 UTC 2009


Hi,

last time I asked, this wasn't possible and I did not follow the latest
development. So here's my question again:

I have a custom html/php dialect. It contains of regions of code that
is either html markup or php code.

<php>...</php>

and

<htm>...</htm>

Inside a php region, you can use <htm> and inside a markup
region, you can use <php> which leads to recursive a structure
that is very helpful for programming (at least for me) but
harder to colorize, fold or autocomplete correctly.

More complex example (outmost default is html markup):

<html>
     <head>
         <php>
             echo convert($title);
         </php>
         <style> ..... </style>
     </head>
     <php> init(); </php>
     <body>
         Result:
         <php>
             if($someflag)
             <htm>
                 <table border="0">
                 <php>
                     foreach $row ($rows)
                     {
                         <htm><tr><td></htm>
                         echo $row;
                         <htm></td></tr></htm>
                     }
                 </php>
                 </table>
             </htm>
         </php>
     </body>
</html>

Can I customize Textmate so its html and php modules identify my  
regions?

/Andreas Pardeike



More information about the textmate mailing list