about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-10-27 22:46:11 -0700
committerKartik Agaram <vc@akkartik.com>2018-10-27 22:46:23 -0700
commit5f21a5e788402345f97e8bc934259e960ba0f334 (patch)
tree686ce7ef76e90775903d33916017a6cdc9a80e91
parent5e5f569c1777e4062b2d4379ed4b17b9d0b18281 (diff)
downloadmu-5f21a5e788402345f97e8bc934259e960ba0f334.tar.gz
4726
-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*$"
href='#n393'>393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747