--- loncom/homework/CAPA-converter/capaLexerDef.flex 2001/11/21 18:48:05 1.11 +++ loncom/homework/CAPA-converter/capaLexerDef.flex 2001/11/29 18:43:55 1.13 @@ -691,6 +691,7 @@ EndLine ([\r][\n]|[\n]) {FileName}{Space}* { char *endquote; end_mode(); start_mode(MODE_IMPORT,NULL); + /* Get rid of leading and trailing quotes */ endquote = strrchr(yytext,'\"'); *endquote = '\0'; if (yytext[1] == '/') { @@ -698,14 +699,15 @@ EndLine ([\r][\n]|[\n]) } else { send("%s",&yytext[1]); } + end_mode(); + BEGIN S_SKIP; } {Identifier}{Space}* { end_mode(); start_mode(MODE_IMPORT,NULL); send("$%s",yytext); + end_mode(); + BEGIN S_SKIP; } -{Space}+ { } -{EndLine} {end_mode(); BEGIN S_TEXT;} - } { @@ -935,6 +937,7 @@ EndLine ([\r][\n]|[\n]) BEGIN S_ECHO; } } +[%] {send("%%");} {Operator} { LLDBUG_PR2("[Op(%c) in VAR,TF_STMT,LET]",yytext[0]); send(yytext); } } @@ -993,6 +996,9 @@ EndLine ([\r][\n]|[\n]) send("'"); yy_pop_state(); } +[%] { /*Escape percent signs so that vasprintf doesn't choke */ + send("%%"); + } {EndLine} { /* check for termination of string constant */ char warn_msg[WARN_MSG_LENGTH];