#!/bin/sh # BlaiseV: Blaise Pascal syntax validator front-end. # Filters TEXT_BLOCK literals to plain strings (length-preserving, so # diagnostics keep exact positions), then runs the Coco/R validator. HERE="$(dirname "$0")" SRC="$1" if [ -z "$SRC" ]; then echo "No input file specified" exit 1 fi TMP="$(mktemp /tmp/blaisev.XXXXXX.pas)" "$HERE/BlaiseTF" "$SRC" "$TMP" 2>/dev/null || { echo "Could not filter input file"; rm -f "$TMP"; exit 1; } "$HERE/BlaiseParse" "$TMP" RC=$? # move the listing next to the original source under its basename DIR="$(dirname "$SRC")" BASE="$(basename "$SRC")" BASE="${BASE%.*}" if [ -f "$TMP.LST" ] || [ -f "${TMP%.pas}.LST" ]; then for L in "$TMP.LST" "${TMP%.pas}.LST"; do if [ -f "$L" ]; then mv "$L" "$DIR/$BASE.LST"; fi done fi rm -f "$TMP" "${TMP%.pas}".* exit $RC