27 lines
1.7 KiB
Bash
27 lines
1.7 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
# Script to run all compiler error examples and see the error messages
|
||
|
|
|
||
|
|
cd "$(dirname "$0")/../.."
|
||
|
|
|
||
|
|
echo "════════════════════════════════════════════════════════════════"
|
||
|
|
echo "STORYBOOK COMPILER ERRORS - EXAMPLES"
|
||
|
|
echo "════════════════════════════════════════════════════════════════"
|
||
|
|
echo ""
|
||
|
|
|
||
|
|
for file in tests/compiler_errors/*.sb; do
|
||
|
|
if [ -f "$file" ]; then
|
||
|
|
echo "═══════════════════════════════════════════════════════════════════"
|
||
|
|
echo "File: $(basename "$file")"
|
||
|
|
echo "═══════════════════════════════════════════════════════════════════"
|
||
|
|
cat "$file" | head -3 | tail -2 # Show the comment lines
|
||
|
|
echo ""
|
||
|
|
cargo run --quiet --bin sb -- validate "$file" 2>&1 || true
|
||
|
|
echo ""
|
||
|
|
echo ""
|
||
|
|
fi
|
||
|
|
done
|
||
|
|
|
||
|
|
echo "════════════════════════════════════════════════════════════════"
|
||
|
|
echo "ALL EXAMPLES COMPLETE"
|
||
|
|
echo "════════════════════════════════════════════════════════════════"
|