Support -P/--preinclude to pre-INCLUDE a file (#1043)

Fixes #1041

Co-authored-by: ISSOtm <eldredhabert0@gmail.com>
This commit is contained in:
Rangi
2022-09-24 12:37:16 -04:00
committed by GitHub
parent 02923a67f3
commit b8385a50e3
13 changed files with 121 additions and 11 deletions

View File

@@ -76,6 +76,11 @@ if ! diff --strip-trailing-cr syntax-error.err $errput; then
fi
for i in *.asm; do
flags=${i%.asm}.flags
RGBASMFLAGS=-Weverything
if [ -f $flags ]; then
RGBASMFLAGS="$(head -n 1 "$flags")" # Allow other lines to serve as comments
fi
for variant in '' '.pipe'; do
echo "${bold}${green}${i%.asm}${variant}...${rescolors}${resbold}"
desired_errname=${i%.asm}.err
@@ -83,7 +88,7 @@ for i in *.asm; do
desired_errname=${i%.asm}.simple.err
fi
if [ -z "$variant" ]; then
$RGBASM -Weverything -o $o $i > $output 2> $errput
$RGBASM $RGBASMFLAGS -o $o $i > $output 2> $errput
desired_output=${i%.asm}.out
desired_errput=$desired_errname
else
@@ -97,7 +102,7 @@ for i in *.asm; do
# stdin redirection makes the input an unseekable pipe - a scenario
# that's harder to deal with and was broken when the feature was
# first implemented.
cat $i | $RGBASM -Weverything -o $o - > $output 2> $errput
cat $i | $RGBASM $RGBASMFLAGS -o $o - > $output 2> $errput
# Use two otherwise unused files for temp storage
desired_output=$input