%START NORM VERB VERBENV
sp [ \t]*
nl {sp}\n{sp}
+comment \%.*$
miranda ([0-9]+(\-([0-9]+)?)?)?>
%{
#define PUSH states[top++] =
#define POP BEGIN states[--top]
#define yywrap() 1
+#define YY_SKIP_YYWRAP
%}
%%
int states[256];
top = 0;
<NORM>@@ { printf ("@"); }
<NORM>@ { printf ("<tt>"); PUSH NORM; BEGIN VERB; }
+<NORM>\\% { printf ("%"); }
+<NORM>{comment} { }
<VERB>@ { printf ("</tt>"); POP; }
<VERB>@@ { printf ("@"); }
<VERB>\> { printf (">"); }
<VERB>\~ { printf ("˜"); }
<VERB>\^ { printf ("ˆ"); }
-<NORM>\<verb\> { printf ("<verb>"); PUSH NORM; BEGIN VERBENV; }
-<VERBENV>\<\/verb\> { printf ("</verb>"); POP; }
-<VERBENV>\&\& { printf ("&"); }
-<VERBENV>\& { printf ("&ero;"); }
-<VERBENV>\<\/ { printf ("&etago;"); }
+<NORM>\<verb\> { printf ("<verb>"); PUSH NORM; BEGIN VERBENV; }
+<NORM>\<code\> { printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
+<NORM>\\begin\{code\} { printf ("<code>"); PUSH NORM; BEGIN VERBENV; }
+<VERBENV>\<\/verb\> { printf ("</verb>"); POP; }
+<VERBENV>\<\/code\> { printf ("</code>"); POP; }
+<VERBENV>\<\\end\{code\} { printf ("</code>"); POP; }
+<VERBENV>\&\& { printf ("&"); }
+<VERBENV>\& { printf ("&ero;"); }
+<VERBENV>\<\/ { printf ("&etago;"); }
%%
int