#!/usr/bin/env bash
# this is the sany syntactic analyzer, which parses and checks the spec for syntax errors.
class_paths=(/Applications/TLA+\ Toolbox.app/Contents/Eclipse/plugins/org.lamport.tlatools_*)
export CLASSPATH=${class_paths[${#class_paths[@]}-1]}
libs="-DTLA-Library=$HOME/.warehouse/tools/tlaplus/libs"
# sanny
! java $libs tla2sany.SANY "$@" | tee /dev/tty | grep -q error