jvm-bytecode-tools: jasmin-line-numbers.diff

File jasmin-line-numbers.diff, 2.3 KB (added by Mark Evenson, 10 years ago)

Patch to fix display of line numbers in jasmin.el

  • jasmin.el

    # 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  
    7070(require 'faces)
    7171(require 'font-lock)
    7272
    73 (defconst jasmin-version "1.2")
     73(defconst jasmin-version "1.3")
    7474
    7575(defconst jasmin-author "Neil W. Van Dyke <neil@neilvandyke.org>")
    7676
     
    357357    (int2short . [() "Integer to short conversion"])
    358358    (invokenonvirtual . [(method-spec)
    359359                         "Invoke instance method via compile-time type"])
     360    (invokespecial . [(method-spec)
     361                      "Invoke instance method with special handling for superclass, private, and instance initialization."])
    360362    (invokestatic . [(method-spec) "Invoke class (static) method"])
    361363    (invokevirtual . [(method-spec)
    362364                      "Invoke instance method via run-time type"])
     
    575577     (list (concat line-beg "\\(default\\)" jasmin-optional-whitespace-regexp
    576578                   ":")
    577579           (list 1 'jasmin-case-default-face))
     580     ;; pc label
     581     (list (concat line-beg "\\(" "[0-9]+" "\\)" ":")
     582           (list 1 'jasmin-label-face))
    578583     ;; Label.
    579584     (list (concat line-beg "\\(" jasmin-label-name-regexp "\\)"
    580585                   jasmin-optional-whitespace-regexp ":")
     
    680685(defun jasmin-in-method-p (context)
    681686  (memq context '(method lookupswitch tableswitch)))
    682687
     688(defvar jasmin-instruction-regexp "[a-zA-Z][a-zA-Z0-9_]*\\>")
     689
    683690(defun jasmin-indent-line () ;;&optional arg)
    684691  ;;(interactive "P")
    685692  (let ((context (jasmin-line-context)))
     
    738745          (jasmin-force-no-space (match-beginning 1) (match-end 1)))
    739746      (indent-to-column jasmin-label-indent))
    740747     ;; 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)))
    742751           (eq context 'method))
    743752      (indent-to-column jasmin-instruction-indent))
    744753     ;; Other.
     
    747756
    748757;; TODO: defun jasmin-indent-region-function (start end to-column)
    749758
     759
    750760(defun jasmin-line-context ()
    751761  (save-excursion
    752762    (let (context)