#!/bin/bash
# Runs the example with the flags of SPRITE_INTERPRETER_FLAGS.
set -euo pipefail
cd "$(dirname "$0")"
: "${SPRITE_HOME:=$(cd ../.. && pwd)/install}"
export SPRITE_HOME
export SPRITE_INTERPRETER_FLAGS="${SPRITE_INTERPRETER_FLAGS:-backend:cxx}"
export LC_ALL=C.UTF-8 PYTHONIOENCODING=utf-8
unset CURRYPATH
# The rules of PermSort.insert overlap by design: each insertion
# position is a choice.  Silence the warning unless the environment sets it.
export SPRITE_FRONTEND_WARNINGS="${SPRITE_FRONTEND_WARNINGS:-0}"
echo '% python go.py'
"$SPRITE_HOME/bin/python" go.py
