This commit is contained in:
Kartik Agaram 2018-10-27 22:46:11 -07:00
parent 5e5f569c17
commit 5f21a5e788
9 changed files with 49 additions and 6 deletions

4
subx/c
View File

@ -1,4 +1,4 @@
#!/usr/bin/env zsh
# Make opening various versions of the Crenshaw compiler even more convenient.
# Make editing various versions of the Crenshaw compiler even more convenient.
edit crenshaw$1
./edit crenshaw$1

4
subx/cb Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env zsh
# Make building various versions of the Crenshaw compiler even more convenient.
gen crenshaw$1

4
subx/cr Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env zsh
# Make running various versions of the Crenshaw compiler even more convenient.
run crenshaw$1

4
subx/dcr Executable file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env zsh
# Make opening various versions of the Crenshaw compiler even more convenient.
./dgen crenshaw$1 && ./drun crenshaw$1

11
subx/dgen Executable file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env zsh
# Build commonly-used SubX programs in 'debug mode'.
if [[ $1 == 'ex'* ]]
then
CFLAGS=-g ./subx --map translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'`
exit $?
fi
CFLAGS=-g ./subx --map translate *.subx apps/$1.subx -o apps/`echo $1 |sed 's/\..*//'`
exit $?

17
subx/drun Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
# Run commonly-used SubX programs using the SubX VM in 'debug mode'.
if [ $# -eq 0 ]
then
echo "drun <binary> <args>"
exit 1
fi
if [[ $1 == 'ex'* ]]
then
CFLAGS=-g ./subx --map --dump run examples/$* 2>x
exit $?
fi
CFLAGS=-g ./subx --map --dump run apps/$* 2>x
exit $?

View File

@ -3,9 +3,9 @@
if [[ $1 == 'ex'* ]]
then
CFLAGS=-g subx translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'`
CFLAGS=-g ./subx translate examples/$1.subx -o examples/`echo $1 |sed 's/\..*//'`
exit $?
fi
CFLAGS=-g subx translate *.subx apps/$1.subx -o apps/`echo $1 |sed 's/\..*//'`
CFLAGS=-g ./subx translate *.subx apps/$1.subx -o apps/`echo $1 |sed 's/\..*//'`
exit $?

View File

@ -9,9 +9,9 @@ fi
if [[ $1 == 'ex'* ]]
then
CFLAGS=-g subx run examples/$*
CFLAGS=-g ./subx run examples/$*
exit $?
fi
CFLAGS=-g subx run apps/$*
CFLAGS=-g ./subx run apps/$*
exit $?

View File

@ -83,6 +83,9 @@ endfunction
command! -nargs=1 G call GrepSubX(<q-args>)
" temporary helpers while we port https://github.com/akkartik/crenshaw to apps/crenshaw*.subx
command! -nargs=1 C exec "E crenshaw".<f-args>
command! -nargs=1 CS exec "S crenshaw".<f-args>
command! -nargs=1 CH exec "H crenshaw".<f-args>
function! Orig()
let l:p = expand("%:t:r")
if l:p =~ "^crenshaw\\d*-\\d*$"