Preprocessing writes the intermediate output to *.preprocessed files. This makes debugging various DSL syntax errors much easier since the line number in the error corresponds to the line numbers in these files.

This commit is contained in:
jpekkila
2019-10-01 21:08:38 +03:00
parent d4eaee7d47
commit b4a6ddb074

View File

@@ -1,4 +1,4 @@
#!/bin/bash
# Preprocesses the give file using GCC. This script is usually automatically called in
# ./compile.sh, but may be called also individually for debugging purposes.
cat $1 | gcc ${@:2} -x c -E - | sed "s/#.*//g"
cat $1 | gcc ${@:2} -x c -E - | sed "s/#.*//g" | tee ${PWD}/$(basename -- "$1").preprocessed