mes/scripts/include.mes
Jan Nieuwenhuizen d4dc29c498 Resurrect guile-mescc with guile-2.1.5.
* scripts/include.mes: Grep all files.
* GNUmakefile (mescc.cat): Update for mes-use-module; list all toplevel inputs.
* module/language/c/lexer.mes: Use (system base lalr).
* module/language/c/parser.mes: Likewise.
* module/language/c/compiler.mes: Likewise.  Remove encoding on output port.
* scripts/mescc.mes: Remove BROKEN comment.
2016-12-17 10:57:38 +01:00

24 lines
577 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 $@ \
| grep -Eo '^\(mes-use-module \([^ ()]+ [^()]+))' \
| grep -Eo ' \([^)]+\)' \
| sed -e "s@^ *(@${prefix}/module/@" -e 's@ @/@g' -e 's@)@.mes@'