/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: 2010-09-08 02:42:09 UTC
  • Revision ID: distler@golem.ph.utexas.edu-20100908024209-t695yec87kx3rrk6
Tags: 1.4.1
itex2MML 1.4.1: Memory issue

I don't think that string-buffer manipulation
in 1.4.0 was totally kosher. It seemed to do
weird things (but not predictably) to the state
of the lexer. This works better.

Show diffs side-by-side

added added

removed removed

1
 
/*             itex2MML 1.4.0
 
1
/*             itex2MML 1.4.1
2
2
 *   itex2MML.l last modified 9/7/2010
3
3
 */
4
4
 
101
101
"["             {yylval=itex2MML_copy_string(yytext); return LEFTDELIM;}
102
102
 
103
103
")"   {yylval=itex2MML_copy_string(yytext); return RIGHTDELIM;}
104
 
"]"             {if(itex2MML_inoptarg==1) {itex2MML_inoptarg=0; return OPTARGCLOSE;} else {yylval=itex2MML_copy_string(yytext); return RIGHTDELIM;}}
 
104
"]"   {if(itex2MML_inoptarg==1) {itex2MML_inoptarg=0; return OPTARGCLOSE;} else {yylval=itex2MML_copy_string(yytext); return RIGHTDELIM;}}
105
105
 
106
106
"\\lbrace" |
107
107
"\\{"           {yylval=itex2MML_copy_string("{"); return LEFTDELIM;}
377
377
"\\xrightleftharpoons" |
378
378
"\\xhookleftarrow"     |
379
379
"\\xhookrightarrow"    |
380
 
"\\xmapsto" {BEGIN(OPTARG); yylval=itex2MML_copy_string(yytext+1); if (yylval != itex2MML_empty_string) {yylval[0]='&'; yylval[yyleng-1]=';'; yylval[yyleng]='\0';} return XARROW;}
 
380
"\\xmapsto" {BEGIN(OPTARG); char * s1 = itex2MML_copy_string(yytext+2); yylval = itex2MML_copy3("&", s1, ";"); itex2MML_free_string(s1); return XARROW;}
381
381
 
382
382
"\\dots" |
383
383
"\\ldots"  {yylval=itex2MML_copy_string("…"); return MI;}