# HG changeset patch
# User Mark <evenson@panix.com>
# Date 1269164544 -3600
# Node ID 4115a3879df06b35c77682c077b6e7ecabe8a0c5
# Parent 03c18c69174be987d21eb40693a0bf7d6ba2ad3f
Trying to get pc ("line numbers") working.
diff --git a/jasmin.el b/jasmin.el
|
a
|
b
|
|
| 70 | 70 | (require 'faces) |
| 71 | 71 | (require 'font-lock) |
| 72 | 72 | |
| 73 | | (defconst jasmin-version "1.2") |
| | 73 | (defconst jasmin-version "1.3") |
| 74 | 74 | |
| 75 | 75 | (defconst jasmin-author "Neil W. Van Dyke <neil@neilvandyke.org>") |
| 76 | 76 | |
| … |
… |
|
| 357 | 357 | (int2short . [() "Integer to short conversion"]) |
| 358 | 358 | (invokenonvirtual . [(method-spec) |
| 359 | 359 | "Invoke instance method via compile-time type"]) |
| | 360 | (invokespecial . [(method-spec) |
| | 361 | "Invoke instance method with special handling for superclass, private, and instance initialization."]) |
| 360 | 362 | (invokestatic . [(method-spec) "Invoke class (static) method"]) |
| 361 | 363 | (invokevirtual . [(method-spec) |
| 362 | 364 | "Invoke instance method via run-time type"]) |
| … |
… |
|
| 575 | 577 | (list (concat line-beg "\\(default\\)" jasmin-optional-whitespace-regexp |
| 576 | 578 | ":") |
| 577 | 579 | (list 1 'jasmin-case-default-face)) |
| | 580 | ;; pc label |
| | 581 | (list (concat line-beg "\\(" "[0-9]+" "\\)" ":") |
| | 582 | (list 1 'jasmin-label-face)) |
| 578 | 583 | ;; Label. |
| 579 | 584 | (list (concat line-beg "\\(" jasmin-label-name-regexp "\\)" |
| 580 | 585 | jasmin-optional-whitespace-regexp ":") |
| … |
… |
|
| 680 | 685 | (defun jasmin-in-method-p (context) |
| 681 | 686 | (memq context '(method lookupswitch tableswitch))) |
| 682 | 687 | |
| | 688 | (defvar jasmin-instruction-regexp "[a-zA-Z][a-zA-Z0-9_]*\\>") |
| | 689 | |
| 683 | 690 | (defun jasmin-indent-line () ;;&optional arg) |
| 684 | 691 | ;;(interactive "P") |
| 685 | 692 | (let ((context (jasmin-line-context))) |
| … |
… |
|
| 738 | 745 | (jasmin-force-no-space (match-beginning 1) (match-end 1))) |
| 739 | 746 | (indent-to-column jasmin-label-indent)) |
| 740 | 747 | ;; Instruction. |
| 741 | | ((and (looking-at "[a-zA-Z][a-zA-Z0-9_]*\\>") |
| | 748 | ((and (or (looking-at jasmin-instruction-regexp) |
| | 749 | (looking-at |
| | 750 | (concat "[0-9]+:[ \t]+" jasmin-instruction-regexp))) |
| 742 | 751 | (eq context 'method)) |
| 743 | 752 | (indent-to-column jasmin-instruction-indent)) |
| 744 | 753 | ;; Other. |
| … |
… |
|
| 747 | 756 | |
| 748 | 757 | ;; TODO: defun jasmin-indent-region-function (start end to-column) |
| 749 | 758 | |
| | 759 | |
| 750 | 760 | (defun jasmin-line-context () |
| 751 | 761 | (save-excursion |
| 752 | 762 | (let (context) |