mes/scripts/include.mes
Jan Nieuwenhuizen 2586f0bb2c Move optional type predicates to type.c.
* mes.c (char_p, macro_p, number_p, pair_p, string_p, symbol_p,
  vector_p, builtin_p, boolean_p): Move to type.c
* type.c: New file.
* GNUmakefile (mes.o): Depend on type snarf output.
* module/mes/loop-0.mes (cond, map, let, or, and not, evlis-env,
  apply-env, eval-expand, uquote, add-unquoters, eval,
  expand-macro-env, eval-begin-env, eval-if-env, sexp:define,
  env:define, env:macro): Move to mes-0.mes.
* module/mes/mes-0.mes: New file.
* module/mes/type-0.mes: New file.
* scripts/include.mes: If BOOT, also include mes-0.mes.  If TYPE0,
  also include type-0.mes.
2016-10-22 12:16:19 +02:00

24 lines
574 B
Bash
Executable file

#! /bin/sh
if [ "$1" == "--help" ]; then
echo "Usage: include.mes FILE"
exit 0
fi
for prefix in $(dirname $(dirname $0))/share/mes . $(dirname $(dirname $0)); do
if [ -d ${prefix}/module ]; then
break;
fi
done
if [ -n "$BOOT" ]; then
echo $prefix/module/mes/loop-0.mes
if [ -n "$TYPE0" ]; then
echo $prefix/module/mes/type-0.mes
fi
echo $prefix/module/mes/mes-0.mes
fi
cat $1 \
| grep -Eo '(mes-use-module \([^()]+ [^()]+))' \
| grep -Eo ' \([^)]+\)' \
| sed -e "s@^ *(@${prefix}/module/@" -e 's@ @/@g' -e 's@)@.mes@'