X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=fml%2Ffmltoken.c;h=16a0cd5afb3934e17fb966cfdcb066d3e710383f;hb=6fe22f1f3fae94d4becdc972c0c21dd280ffbe9b;hp=fc4d1893c75f55e599b59c82c6fad3c8078f6b7b;hpb=372b7a22555387ae193ed303132342e654319420;p=egate.git diff --git a/fml/fmltoken.c b/fml/fmltoken.c index fc4d189..16a0cd5 100644 --- a/fml/fmltoken.c +++ b/fml/fmltoken.c @@ -2,7 +2,14 @@ * FML interpreter. Europagate, 1995 * * $Log: fmltoken.c,v $ - * Revision 1.3 1995/02/10 15:50:57 adam + * Revision 1.6 1995/02/23 08:32:07 adam + * Changed header. + * + * Revision 1.4 1995/02/10 18:15:53 adam + * FML function 'strcmp' implemented. This function can be used to + * test for existence of MARC fields. + * + * Revision 1.3 1995/02/10 15:50:57 adam * MARC interface implemented. Minor bugs fixed. fmltest can * be used to format single MARC records. New function '\list' * implemented. @@ -42,6 +49,11 @@ struct fml_node *fml_tokenize (Fml fml) fml_pr_list (p); printf ("\n"); } + if (look_char != fml->eof_mark) + { + fprintf (stderr, "Ill formed parantheses"); + exit (1); + } return p; } @@ -157,6 +169,24 @@ static void lexer (Fml fml) while (look_char != fml->eof_mark && look_char != '\'') { lex_buf[off++] = look_char; + if (look_char == '\\') + { + look_char = (*fml->read_func)(); + switch (look_char) + { + case 'n': + lex_buf[off-1] = '\n'; + break; + case 't': + lex_buf[off-1] = '\n'; + break; + case '\'': + lex_buf[off-1] = '\''; + break; + default: + lex_buf[off-1] = look_char; + } + } look_char = (*fml->read_func)(); } lex_buf[off] = '\0';