Mercurial > emacs
comparison lisp/progmodes/asm-mode.el @ 49402:99a31f21f1c9
(asm-mode): Added syntax table entries for /* */ comments.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 23 Jan 2003 09:11:46 +0000 |
parents | eb15bee6f5e7 |
children | 288cda7c05fb |
comparison
equal
deleted
inserted
replaced
49401:a57a71b7eaae | 49402:99a31f21f1c9 |
---|---|
126 ;; so we can define our own comment character. | 126 ;; so we can define our own comment character. |
127 (use-local-map (nconc (make-sparse-keymap) asm-mode-map)) | 127 (use-local-map (nconc (make-sparse-keymap) asm-mode-map)) |
128 (local-set-key (vector asm-comment-char) 'asm-comment) | 128 (local-set-key (vector asm-comment-char) 'asm-comment) |
129 | 129 |
130 (modify-syntax-entry asm-comment-char | 130 (modify-syntax-entry asm-comment-char |
131 "<" asm-mode-syntax-table) | 131 "< b" asm-mode-syntax-table) |
132 (modify-syntax-entry ?\n | 132 (modify-syntax-entry ?\n |
133 ">" asm-mode-syntax-table) | 133 "> b" asm-mode-syntax-table) |
134 | |
135 (modify-syntax-entry ?/ ". 14" asm-mode-syntax-table) | |
136 (modify-syntax-entry ?* ". 23" asm-mode-syntax-table) | |
137 | |
134 (let ((cs (regexp-quote (char-to-string asm-comment-char)))) | 138 (let ((cs (regexp-quote (char-to-string asm-comment-char)))) |
135 (make-local-variable 'comment-start) | 139 (make-local-variable 'comment-start) |
136 (setq comment-start (concat (char-to-string asm-comment-char) " ")) | 140 (setq comment-start (concat (char-to-string asm-comment-char) " ")) |
137 (make-local-variable 'comment-start-skip) | 141 (make-local-variable 'comment-start-skip) |
138 (setq comment-start-skip (concat cs "+[ \t]*")) | 142 (setq comment-start-skip (concat cs "+[ \t]*")) |
211 ;; Flush-left comment present? Just insert character. | 215 ;; Flush-left comment present? Just insert character. |
212 ((asm-line-matches asm-flush-left-empty-comment-pattern) | 216 ((asm-line-matches asm-flush-left-empty-comment-pattern) |
213 (insert asm-comment-char)) | 217 (insert asm-comment-char)) |
214 | 218 |
215 ;; Empty code-level comment already present? | 219 ;; Empty code-level comment already present? |
216 ;; Then start flush-left comment, on line above if this one is nonempty. | 220 ;; Then start flush-left comment, on line above if this one is nonempty. |
217 ((asm-line-matches asm-code-level-empty-comment-pattern) | 221 ((asm-line-matches asm-code-level-empty-comment-pattern) |
218 (asm-pop-comment-level) | 222 (asm-pop-comment-level) |
219 (insert asm-comment-char asm-comment-char comment-start)) | 223 (insert asm-comment-char asm-comment-char comment-start)) |
220 | 224 |
221 ;; Empty comment ends line? | 225 ;; Empty comment ends line? |
222 ;; Then make code-level comment, on line above if this one is nonempty. | 226 ;; Then make code-level comment, on line above if this one is nonempty. |
223 ((asm-line-matches asm-inline-empty-comment-pattern) | 227 ((asm-line-matches asm-inline-empty-comment-pattern) |
224 (asm-pop-comment-level) | 228 (asm-pop-comment-level) |
225 (tab-to-tab-stop) | 229 (tab-to-tab-stop) |
226 (insert asm-comment-char comment-start)) | 230 (insert asm-comment-char comment-start)) |
227 | 231 |