4725 - back to porting the Crenshaw compiler

This commit is contained in:
Kartik Agaram 2018-10-26 10:12:51 -07:00
parent 1f08b541af
commit 5e5f569c17
5 changed files with 16 additions and 3 deletions

4
subx/c Executable file
View File

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

View File

@ -1,5 +1,5 @@
#!/usr/bin/env zsh
# Open a specific example.
# Open commonly-used SubX programs.
if [ $# -eq 0 ]
then

View File

@ -1,5 +1,5 @@
#!/usr/bin/env zsh
# Build a specific example.
# Build commonly-used SubX programs.
if [[ $1 == 'ex'* ]]
then

View File

@ -1,5 +1,5 @@
#!/usr/bin/env zsh
# Simulate a specific example using subx.
# Run commonly-used SubX programs using the SubX VM.
if [ $# -eq 0 ]
then

View File

@ -81,3 +81,12 @@ function! GrepSubX(regex)
silent exec "r !grep -h '".a:regex."' *.subx */*.subx"
endfunction
command! -nargs=1 G call GrepSubX(<q-args>)
" temporary helpers while we port https://github.com/akkartik/crenshaw to apps/crenshaw*.subx
function! Orig()
let l:p = expand("%:t:r")
if l:p =~ "^crenshaw\\d*-\\d*$"
exec "vert split crenshaw/tutor" . substitute(expand("%:t:r"), "^crenshaw\\(\\d*\\)-\\(\\d*\\)$", "\\1.\\2", "") . ".pas"
endif
endfunction
command! O call Orig()