/itexToMML

To download this project, use:
bzr branch http://golem.ph.utexas.edu/~distler/code/itexToMML/

« back to all changes in this revision

Viewing changes to itex-src/itex2MML.l

  • Committer: Jacques Distler
  • Date: 2013-12-08 16:55:17 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20131208165517-vvk8ranvb352nqzt
itex2MML 1.5.0beta4

Fix bug in equation capture during
optarg parsing.
Thanks to Frederic Wang for reporting
the bug.

Show diffs side-by-side

added added

removed removed

953
953
<OPTARG>{
954
954
"[" {if(itex2MML_optarg_ind < itex2MML_optarg_depth - 1 && itex2MML_inoptarg[itex2MML_optarg_ind] !=1 ){itex2MML_optarg_ind++; itex2MML_inoptarg[itex2MML_optarg_ind]=1;}; BEGIN(MATH); return OPTARGOPEN;}
955
955
[\n\r\t ]+    ;
956
 
.   {BEGIN(MATH); unput(yytext[0]);}
 
956
.   {itex2MML_eqn_buffer[itex2MML_eqn_end-itex2MML_eqn_src]=0; --itex2MML_eqn_end; BEGIN(MATH); unput(yytext[0]);}
957
957
}
958
958
 
959
959
<RAISEBOX1>{
968
968
 
969
969
<TEXTOPTARG1>{
970
970
\[[^\]]*?\] {yylval=itex2MML_copy_string(yytext+1); if ((yyleng > 1) && (yylval != itex2MML_empty_string)) yylval[yyleng-2]='\0'; BEGIN(TEXTOPTARG); return TEXTSTRING;}
971
 
. {BEGIN(MATH); unput(yytext[0]);}
 
971
. {itex2MML_eqn_buffer[itex2MML_eqn_end-itex2MML_eqn_src]=0; --itex2MML_eqn_end; BEGIN(MATH); unput(yytext[0]);}
972
972
}
973
973
 
974
974
<TEXTOPTARG>{
975
975
\[[^\]]*?\] {yylval=itex2MML_copy_string(yytext+1); if ((yyleng > 1) && (yylval != itex2MML_empty_string)) yylval[yyleng-2]='\0'; BEGIN(MATH); return TEXTSTRING;}
976
 
. {BEGIN(MATH); unput(yytext[0]);}
 
976
. {itex2MML_eqn_buffer[itex2MML_eqn_end-itex2MML_eqn_src]=0; --itex2MML_eqn_end; BEGIN(MATH); unput(yytext[0]);}
977
977
}
978
978
 
979
979
<MATHENV>{