Mercurial > emacs
comparison lisp/progmodes/delphi.el @ 109400:c232035b5f44
(delphi-token-at): Give newlines precedence over literal tokens when
parsing so newlines aren't "absorbed" by single-line comments.
Corrects the indentation of case blocks that have a comment on the
first line.
author | Simon South <ssouth@member.fsf.org> |
---|---|
date | Wed, 14 Jul 2010 22:34:47 -0400 |
parents | 855f55740303 |
children | f0baf5788e14 |
comparison
equal
deleted
inserted
replaced
109399:3fcc8637a887 | 109400:c232035b5f44 |
---|---|
626 token))) | 626 token))) |
627 | 627 |
628 (defun delphi-token-at (p) | 628 (defun delphi-token-at (p) |
629 ;; Returns the token from parsing text at point p. | 629 ;; Returns the token from parsing text at point p. |
630 (when (and (<= (point-min) p) (<= p (point-max))) | 630 (when (and (<= (point-min) p) (<= p (point-max))) |
631 (cond ((delphi-literal-token-at p)) | 631 (cond ((delphi-char-token-at p ?\n 'newline)) |
632 | |
633 ((delphi-literal-token-at p)) | |
632 | 634 |
633 ((delphi-space-token-at p)) | 635 ((delphi-space-token-at p)) |
634 | 636 |
635 ((delphi-word-token-at p)) | 637 ((delphi-word-token-at p)) |
636 | 638 |
637 ((delphi-char-token-at p ?\( 'open-group)) | 639 ((delphi-char-token-at p ?\( 'open-group)) |
638 ((delphi-char-token-at p ?\) 'close-group)) | 640 ((delphi-char-token-at p ?\) 'close-group)) |
639 ((delphi-char-token-at p ?\[ 'open-group)) | 641 ((delphi-char-token-at p ?\[ 'open-group)) |
640 ((delphi-char-token-at p ?\] 'close-group)) | 642 ((delphi-char-token-at p ?\] 'close-group)) |
641 ((delphi-char-token-at p ?\n 'newline)) | |
642 ((delphi-char-token-at p ?\; 'semicolon)) | 643 ((delphi-char-token-at p ?\; 'semicolon)) |
643 ((delphi-char-token-at p ?. 'dot)) | 644 ((delphi-char-token-at p ?. 'dot)) |
644 ((delphi-char-token-at p ?, 'comma)) | 645 ((delphi-char-token-at p ?, 'comma)) |
645 ((delphi-char-token-at p ?= 'equals)) | 646 ((delphi-char-token-at p ?= 'equals)) |
646 ((delphi-char-token-at p ?+ 'plus)) | 647 ((delphi-char-token-at p ?+ 'plus)) |