--- loncom/homework/CAPA-converter/capaLexerDef.flex 2001/11/18 09:49:43 1.10 +++ loncom/homework/CAPA-converter/capaLexerDef.flex 2001/11/29 18:43:55 1.13 @@ -688,18 +688,25 @@ EndLine ([\r][\n]|[\n]) } { -{FileName}{Space}* { +{FileName}{Space}* { char *endquote; end_mode(); start_mode(MODE_IMPORT,NULL); - send("%s/%s",import_prefix,yytext); - end_mode(); - BEGIN S_SKIP; + /* Get rid of leading and trailing quotes */ + endquote = strrchr(yytext,'\"'); + *endquote = '\0'; + if (yytext[1] == '/') { + send("%s%s",import_prefix,&yytext[1]); + } 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; + BEGIN S_SKIP; } } @@ -930,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); } } @@ -988,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];