X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=fml%2Ffmllist.c;h=7fe18c4ae1bf1343195e2312fcaa18f60c245a9d;hb=8467171ebdb5f018740de8d82149c8ccc53d2815;hp=2d8b7ce421e979eda337d88063eb9e3fbf78113b;hpb=2303dccf677f365d57d750bf6b965875257a0ab1;p=egate.git diff --git a/fml/fmllist.c b/fml/fmllist.c index 2d8b7ce..7fe18c4 100644 --- a/fml/fmllist.c +++ b/fml/fmllist.c @@ -2,7 +2,15 @@ * FML interpreter. Europagate, 1995 * * $Log: fmllist.c,v $ - * Revision 1.1 1995/02/09 14:33:37 adam + * Revision 1.4 1995/02/23 08:32:05 adam + * Changed header. + * + * Revision 1.2 1995/02/10 15:50:55 adam + * MARC interface implemented. Minor bugs fixed. fmltest can + * be used to format single MARC records. New function '\list' + * implemented. + * + * Revision 1.1 1995/02/09 14:33:37 adam * Split source fml.c and define relevant build-in functions in separate * files. New operators mult, div, not, llen implemented. * @@ -83,6 +91,24 @@ static struct fml_node *fml_exec_len (Fml fml, struct fml_node **lp, return fn; } +static struct fml_node *fml_exec_list (Fml fml, struct fml_node **lp, + struct token *tp) +{ + struct fml_node *fn = NULL; + + fml_cmd_lex (lp, tp); + if (tp->kind == 'g') + fn = fml_node_copy (fml, tp->sub); + else + { + fn = fml_node_alloc (fml); + fn->is_atom = 1; + fn->p[0] = fml_atom_alloc (fml, tp->tokenbuf); + } + fml_cmd_lex (lp, tp); + return fn; +} + void fml_list_init (Fml fml) { struct fml_sym_info *sym_info; @@ -94,4 +120,8 @@ void fml_list_init (Fml fml) sym_info = fml_sym_add (fml->sym_tab, "llen"); sym_info->kind = FML_CPREFIX; sym_info->prefix = fml_exec_len; + + sym_info = fml_sym_add (fml->sym_tab, "list"); + sym_info->kind = FML_CPREFIX; + sym_info->prefix = fml_exec_list; }