about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xsubx/c4
-rwxr-xr-xsubx/cb4
-rwxr-xr-xsubx/cr4
-rwxr-xr-xsubx/dcr4
-rwxr-xr-xsubx/dgen11
-rwxr-xr-xsubx/drun17
-rwxr-xr-xsubx/gen4
-rwxr-xr-xsubx/run4
-rw-r--r--vimrc.vim3
9 files changed, 49 insertions, 6 deletions
diff --git a/subx/c b/subx/c
index 9583b78e..ddfde99a 100755
--- a/subx/c
+++ b/subx/c
@@ -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
diff --git a/subx/cb b/subx/cb
new file mode 100755
index 00000000..924d9c9e
--- /dev/null
+++ b/subx/cb
@@ -0,0 +1,4 @@
+#!/usr/bin/env zsh
+# Make building various versions of the Crenshaw compiler even more convenient.
+
+gen crenshaw$1
diff --git a/subx/cr b/subx/cr
new file mode 100755
index 00000000..e8ccb420
--- /dev/null
+++ b/subx/cr
@@ -0,0 +1,4 @@
+#!/usr/bin/env zsh
+# Make running various versions of the Crenshaw compiler even more convenient.
+
+run crenshaw$1
diff --git a/subx/dcr b/subx/dcr
new file mode 100755
index 00000000..938dbb56
--- /dev/null
+++ b/subx/dcr
@@ -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
diff --git a/subx/dgen b/subx/dgen
new file mode 100755
index 00000000..c4afbfb2
--- /dev/null
+++ b/subx/dgen
@@ -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 $?
diff --git a/subx/drun b/subx/drun
new file mode 100755
index 00000000..9e802c31
--- /dev/null
+++ b/subx/drun
@@ -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 $?
diff --git a/subx/gen b/subx/gen
index 846d4186..91370ea4 100755
--- a/subx/gen
+++ b/subx/gen
@@ -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 $?
diff --git a/subx/run b/subx/run
index 8c13a3d8..87fa5569 100755
--- a/subx/run
+++ b/subx/run
@@ -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 $?
diff --git a/vimrc.vim b/vimrc.vim
index d5f0e809..f2ad0696 100644
--- a/vimrc.vim
+++ b/vimrc.vim
@@ -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*$"