Mark file as part of Emacs. Correct FSF address in header.
[bpt/emacs.git] / lisp / progmodes / vera-mode.el
1 ;;; vera-mode.el --- major mode for editing Vera files.
2
3 ;; Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 ;; 2006, 2007 Free Software Foundation, Inc.
5
6 ;; Author: Reto Zimmermann <reto@gnu.org>
7 ;; Maintainer: Reto Zimmermann <reto@gnu.org>
8 ;; Version: 2.26
9 ;; Keywords: languages vera
10 ;; WWW: http://www.iis.ee.ethz.ch/~zimmi/emacs/vera-mode.html
11
12 (defconst vera-version "2.18"
13 "Vera Mode version number.")
14
15 (defconst vera-time-stamp "2007-06-11"
16 "Vera Mode time stamp for last update.")
17
18 ;; This file is part of GNU Emacs.
19
20 ;; GNU Emacs is free software; you can redistribute it and/or modify
21 ;; it under the terms of the GNU General Public License as published by
22 ;; the Free Software Foundation; either version 2, or (at your option)
23 ;; any later version.
24
25 ;; GNU Emacs is distributed in the hope that it will be useful,
26 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;; GNU General Public License for more details.
29
30 ;; You should have received a copy of the GNU General Public License
31 ;; along with GNU Emacs; see the file COPYING. If not, write to the
32 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
33 ;; Boston, MA 02110-1301, USA.
34
35 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
36 ;;; Commentary:
37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
38
39 ;; This package provides a simple Emacs major mode for editing Vera code.
40 ;; It includes the following features:
41
42 ;; - Syntax highlighting
43 ;; - Indentation
44 ;; - Word/keyword completion
45 ;; - Block commenting
46 ;; - Works under GNU Emacs and XEmacs
47
48 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
49 ;; Documentation
50
51 ;; See comment string of function `vera-mode' or type `C-c C-h' in Emacs.
52
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54 ;; Installation
55
56 ;; Prerequisites: GNU Emacs 20.X/21.X, XEmacs 20.X/21.X
57
58 ;; Put `vera-mode.el' into the `site-lisp' directory of your Emacs installation
59 ;; or into an arbitrary directory that is added to the load path by the
60 ;; following line in your Emacs start-up file (`.emacs'):
61
62 ;; (setq load-path (cons (expand-file-name "<directory-name>") load-path))
63
64 ;; If you already have the compiled `vera-mode.elc' file, put it in the same
65 ;; directory. Otherwise, byte-compile the source file:
66 ;; Emacs: M-x byte-compile-file -> vera-mode.el
67 ;; Unix: emacs -batch -q -no-site-file -f batch-byte-compile vera-mode.el
68
69 ;; Add the following lines to the `site-start.el' file in the `site-lisp'
70 ;; directory of your Emacs installation or to your Emacs start-up file
71 ;; (`.emacs'):
72
73 ;; (autoload 'vera-mode "vera-mode" "Vera Mode" t)
74 ;; (setq auto-mode-alist (cons '("\\.vr[hi]?\\'" . vera-mode) auto-mode-alist))
75
76 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
77
78 ;;; Code:
79
80 ;; XEmacs handling
81 (defconst vera-xemacs (string-match "XEmacs" emacs-version)
82 "Non-nil if XEmacs is used.")
83
84 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
85 ;;; Variables
86 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
87
88 (defgroup vera nil
89 "Customizations for Vera Mode."
90 :prefix "vera-"
91 :group 'languages)
92
93 (defcustom vera-basic-offset 2
94 "*Amount of basic offset used for indentation."
95 :type 'integer
96 :group 'vera)
97
98 (defcustom vera-underscore-is-part-of-word nil
99 "*Non-nil means consider the underscore character `_' as part of word.
100 An identifier containing underscores is then treated as a single word in
101 select and move operations. All parts of an identifier separated by underscore
102 are treated as single words otherwise."
103 :type 'boolean
104 :group 'vera)
105
106 (defcustom vera-intelligent-tab t
107 "*Non-nil means `TAB' does indentation, word completion and tab insertion.
108 That is, if preceeding character is part of a word then complete word,
109 else if not at beginning of line then insert tab,
110 else if last command was a `TAB' or `RET' then dedent one step,
111 else indent current line.
112 If nil, TAB always indents current line."
113 :type 'boolean
114 :group 'vera)
115
116
117 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
118 ;;; Mode definitions
119 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
120
121 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
122 ;; Key bindings
123
124 (defvar vera-mode-map ()
125 "Keymap for Vera Mode.")
126
127 (setq vera-mode-map (make-sparse-keymap))
128 ;; backspace/delete key bindings
129 (define-key vera-mode-map [backspace] 'backward-delete-char-untabify)
130 (unless (boundp 'delete-key-deletes-forward) ; XEmacs variable
131 (define-key vera-mode-map [delete] 'delete-char)
132 (define-key vera-mode-map [(meta delete)] 'kill-word))
133 ;; standard key bindings
134 (define-key vera-mode-map "\M-e" 'vera-forward-statement)
135 (define-key vera-mode-map "\M-a" 'vera-backward-statement)
136 (define-key vera-mode-map "\M-\C-e" 'vera-forward-same-indent)
137 (define-key vera-mode-map "\M-\C-a" 'vera-backward-same-indent)
138 ;; mode specific key bindings
139 (define-key vera-mode-map "\C-c\t" 'indent-according-to-mode)
140 (define-key vera-mode-map "\M-\C-\\" 'vera-indent-region)
141 (define-key vera-mode-map "\C-c\C-c" 'vera-comment-uncomment-region)
142 (define-key vera-mode-map "\C-c\C-f" 'vera-fontify-buffer)
143 (define-key vera-mode-map "\C-c\C-v" 'vera-version)
144 (define-key vera-mode-map "\M-\t" 'tab-to-tab-stop)
145 ;; electric key bindings
146 (define-key vera-mode-map "\t" 'vera-electric-tab)
147 (define-key vera-mode-map "\r" 'vera-electric-return)
148 (define-key vera-mode-map " " 'vera-electric-space)
149 (define-key vera-mode-map "{" 'vera-electric-opening-brace)
150 (define-key vera-mode-map "}" 'vera-electric-closing-brace)
151 (define-key vera-mode-map "#" 'vera-electric-pound)
152 (define-key vera-mode-map "*" 'vera-electric-star)
153 (define-key vera-mode-map "/" 'vera-electric-slash)
154
155 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
156 ;; Menu
157
158 (require 'easymenu)
159
160 (easy-menu-define vera-mode-menu vera-mode-map
161 "Menu keymap for Vera Mode."
162 '("Vera"
163 ["(Un)Comment Out Region" vera-comment-uncomment-region (mark)]
164 "--"
165 ["Move Forward Statement" vera-forward-statement t]
166 ["Move Backward Statement" vera-backward-statement t]
167 ["Move Forward Same Indent" vera-forward-same-indent t]
168 ["Move Backward Same Indent" vera-backward-same-indent t]
169 "--"
170 ["Indent Line" indent-according-to-mode t]
171 ["Indent Region" vera-indent-region (mark)]
172 ["Indent Buffer" vera-indent-buffer t]
173 "--"
174 ["Fontify Buffer" vera-fontify-buffer t]
175 "--"
176 ["Documentation" describe-mode]
177 ["Version" vera-version t]
178 ["Bug Report..." vera-submit-bug-report t]
179 "--"
180 ("Options"
181 ["Indentation Offset..." (customize-option 'vera-basic-offset) t]
182 ["Underscore is Part of Word"
183 (customize-set-variable 'vera-underscore-is-part-of-word
184 (not vera-underscore-is-part-of-word))
185 :style toggle :selected vera-underscore-is-part-of-word]
186 ["Use Intelligent Tab"
187 (customize-set-variable 'vera-intelligent-tab
188 (not vera-intelligent-tab))
189 :style toggle :selected vera-intelligent-tab]
190 "--"
191 ["Save Options" customize-save-customized t]
192 "--"
193 ["Customize..." vera-customize t])))
194
195 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
196 ;; Syntax table
197
198 (defvar vera-mode-syntax-table
199 (let ((syntax-table (make-syntax-table)))
200 ;; punctuation
201 (modify-syntax-entry ?\# "." syntax-table)
202 (modify-syntax-entry ?\$ "." syntax-table)
203 (modify-syntax-entry ?\% "." syntax-table)
204 (modify-syntax-entry ?\& "." syntax-table)
205 (modify-syntax-entry ?\' "." syntax-table)
206 (modify-syntax-entry ?\* "." syntax-table)
207 (modify-syntax-entry ?\- "." syntax-table)
208 (modify-syntax-entry ?\+ "." syntax-table)
209 (modify-syntax-entry ?\. "." syntax-table)
210 (modify-syntax-entry ?\/ "." syntax-table)
211 (modify-syntax-entry ?\: "." syntax-table)
212 (modify-syntax-entry ?\; "." syntax-table)
213 (modify-syntax-entry ?\< "." syntax-table)
214 (modify-syntax-entry ?\= "." syntax-table)
215 (modify-syntax-entry ?\> "." syntax-table)
216 (modify-syntax-entry ?\\ "." syntax-table)
217 (modify-syntax-entry ?\| "." syntax-table)
218 ;; string
219 (modify-syntax-entry ?\" "\"" syntax-table)
220 ;; underscore
221 (when vera-underscore-is-part-of-word
222 (modify-syntax-entry ?\_ "w" syntax-table))
223 ;; escape
224 (modify-syntax-entry ?\\ "\\" syntax-table)
225 ;; parentheses to match
226 (modify-syntax-entry ?\( "()" syntax-table)
227 (modify-syntax-entry ?\) ")(" syntax-table)
228 (modify-syntax-entry ?\[ "(]" syntax-table)
229 (modify-syntax-entry ?\] ")[" syntax-table)
230 (modify-syntax-entry ?\{ "(}" syntax-table)
231 (modify-syntax-entry ?\} "){" syntax-table)
232 ;; comment
233 (if vera-xemacs
234 (modify-syntax-entry ?\/ ". 1456" syntax-table) ; XEmacs
235 (modify-syntax-entry ?\/ ". 124b" syntax-table)) ; Emacs
236 (modify-syntax-entry ?\* ". 23" syntax-table)
237 ;; newline and CR
238 (modify-syntax-entry ?\n "> b" syntax-table)
239 (modify-syntax-entry ?\^M "> b" syntax-table)
240 syntax-table)
241 "Syntax table used in `vera-mode' buffers.")
242
243 (defvar vera-mode-ext-syntax-table
244 (let ((syntax-table (copy-syntax-table vera-mode-syntax-table)))
245 ;; extended syntax table including '_' (for simpler search regexps)
246 (modify-syntax-entry ?_ "w" syntax-table)
247 syntax-table)
248 "Syntax table extended by `_' used in `vera-mode' buffers.")
249
250 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
251 ;; Mode definition
252
253 ;;;###autoload (add-to-list 'auto-mode-alist '("\\.vr[hi]?\\'" . vera-mode))
254
255 ;;;###autoload
256 (defun vera-mode ()
257 "Major mode for editing Vera code.
258
259 Usage:
260 ------
261
262 INDENTATION: Typing `TAB' at the beginning of a line indents the line.
263 The amount of indentation is specified by option `vera-basic-offset'.
264 Indentation can be done for an entire region \(`M-C-\\') or buffer (menu).
265 `TAB' always indents the line if option `vera-intelligent-tab' is nil.
266
267 WORD/COMMAND COMPLETION: Typing `TAB' after a (not completed) word looks
268 for a word in the buffer or a Vera keyword that starts alike, inserts it
269 and adjusts case. Re-typing `TAB' toggles through alternative word
270 completions.
271
272 Typing `TAB' after a non-word character inserts a tabulator stop (if not
273 at the beginning of a line). `M-TAB' always inserts a tabulator stop.
274
275 COMMENTS: `C-c C-c' comments out a region if not commented out, and
276 uncomments a region if already commented out.
277
278 HIGHLIGHTING (fontification): Vera keywords, predefined types and
279 constants, function names, declaration names, directives, as well as
280 comments and strings are highlighted using different colors.
281
282 VERA VERSION: OpenVera 1.4 and Vera version 6.2.8.
283
284
285 Maintenance:
286 ------------
287
288 To submit a bug report, use the corresponding menu entry within Vera Mode.
289 Add a description of the problem and include a reproducible test case.
290
291 Feel free to send questions and enhancement requests to <reto@gnu.org>.
292
293 Official distribution is at
294 <http://www.iis.ee.ethz.ch/~zimmi/emacs/vera-mode.html>.
295
296
297 The Vera Mode Maintainer
298 Reto Zimmermann <reto@gnu.org>
299
300 Key bindings:
301 -------------
302
303 \\{vera-mode-map}"
304 (interactive)
305 (kill-all-local-variables)
306 (setq major-mode 'vera-mode)
307 (setq mode-name "Vera")
308 ;; set maps and tables
309 (use-local-map vera-mode-map)
310 (set-syntax-table vera-mode-syntax-table)
311 ;; set local variables
312 (require 'cc-cmds)
313 (set (make-local-variable 'comment-start) "//")
314 (set (make-local-variable 'comment-end) "")
315 (set (make-local-variable 'comment-column) 40)
316 (set (make-local-variable 'comment-start-skip) "/\\*+ *\\|//+ *")
317 (set (make-local-variable 'comment-end-skip) " *\\*+/\\| *//+")
318 (set (make-local-variable 'comment-indent-function) 'c-comment-indent)
319 (set (make-local-variable 'paragraph-start) "^$")
320 (set (make-local-variable 'paragraph-separate) paragraph-start)
321 (set (make-local-variable 'require-final-newline) t)
322 (set (make-local-variable 'indent-tabs-mode) nil)
323 (set (make-local-variable 'indent-line-function) 'vera-indent-line)
324 (set (make-local-variable 'parse-sexp-ignore-comments) t)
325 ;; initialize font locking
326 (set (make-local-variable 'font-lock-defaults)
327 '(vera-font-lock-keywords nil nil ((?\_ . "w"))))
328 ;; add menu (XEmacs)
329 (easy-menu-add vera-mode-menu)
330 ;; miscellaneous
331 (message "Vera Mode %s. Type C-c C-h for documentation." vera-version)
332 ;; run hooks
333 (run-hooks 'vera-mode-hook))
334
335
336 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
337 ;;; Vera definitions
338 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
339
340 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
341 ;;; Keywords
342
343 (defconst vera-keywords
344 '(
345 "after" "all" "any" "around" "assoc_index" "assoc_size" "async"
346 "bad_state" "bad_trans" "before" "begin" "big_endian" "bind"
347 "bin_activation" "bit_normal" "bit_reverse" "break" "breakpoint"
348 "case" "casex" "casez" "class" "constraint" "continue"
349 "coverage" "coverage_block" "coverage_def" "coverage_depth"
350 "coverage_goal" "coverage_group" "coverage_option" "coverage_val"
351 "cross_num_print_missing" "cross_auto_bin_max" "cov_comment"
352 "default" "depth" "dist" "do"
353 "else" "end" "enum" "exhaustive" "export" "extends" "extern"
354 "for" "foreach" "fork" "function"
355 "hdl_task" "hdl_node" "hide"
356 "if" "illegal_self_transition" "illegal_state" "illegal_transition"
357 "in" "interface" "invisible"
358 "join"
359 "little_endian" "local"
360 "m_bad_state" "m_bad_trans" "m_state" "m_trans"
361 "negedge" "new" "newcov" "non_rand" "none" "not" "null"
362 "or" "ordered"
363 "packed" "port" "posedge" "proceed" "prod" "prodget" "prodset"
364 "program" "protected" "public"
365 "rand" "randc" "randcase" "randseq" "repeat" "return" "rules"
366 "sample" "sample_event" "shadow" "soft" "state" "static" "super"
367 "task" "terminate" "this" "trans" "typedef"
368 "unpacked"
369 "var" "vca" "vector" "verilog_node" "verilog_task"
370 "vhdl_node" "vhdl_task" "virtual" "virtuals" "visible" "void"
371 "while" "wildcard" "with"
372 )
373 "List of Vera keywords.")
374
375 (defconst vera-types
376 '(
377 "integer" "bit" "reg" "string" "bind_var" "event"
378 "inout" "input" "output"
379 "ASYNC" "CLOCK"
380 "NDRIVE" "NHOLD" "NRX" "NRZ" "NR0" "NR1" "NSAMPLE"
381 "PDRIVE" "PHOLD" "PRX" "PRZ" "PR0" "PR1" "PSAMPLE"
382 )
383 "List of Vera predefined types.")
384
385 (defconst vera-q-values
386 '(
387 "gnr" "grx" "grz" "gr0" "gr1"
388 "nr" "rx" "rz" "r0" "r1"
389 "snr" "srx" "srz" "sr0" "sr1"
390 )
391 "List of Vera predefined VCA q_values.")
392
393 (defconst vera-functions
394 '(
395 ;; system functions and tasks
396 "alloc"
397 "call_func" "call_task" "cast_assign" "close_conn" "cm_coverage"
398 "cm_get_coverage" "cm_get_limit"
399 "coverage_backup_database_file" "coverage_save_database"
400 "delay"
401 "error" "error_mode" "error_wait" "exit"
402 "fclose" "feof" "ferror" "fflush" "flag" "fopen" "fprintf" "freadb"
403 "freadb" "freadh" "freadstr"
404 "get_bind" "get_bind_id" "get_conn_err" "get_cycle" "get_env"
405 "get_memsize" "get_plus_arg" "get_systime" "get_time" "get_time_unit"
406 "getstate"
407 "initstate"
408 "lock_file"
409 "mailbox_get" "mailbox_put" "mailbox_receive" "mailbox_send"
410 "make_client" "make_server"
411 "os_command"
412 "printf" "psprintf"
413 "query" "query_str" "query_x"
414 "rand48" "random" "region_enter" "region_exit" "rewind"
415 "semaphore_get" "semaphore_put" "setstate" "signal_connect" "simwave_plot"
416 "srandom" "sprintf" "sscanf" "stop" "suspend_thread" "sync"
417 "timeout" "trace" "trigger"
418 "unit_delay" "unlock_file" "up_connections"
419 "urand48" "urandom" "urandom_range"
420 "vera_bit_reverse" "vera_crc" "vera_pack" "vera_pack_big_endian"
421 "vera_plot" "vera_report_profile" "vera_unpack" "vera_unpack_big_endian"
422 "vsv_call_func" "vsv_call_task" "vsv_close_conn" "vsv_get_conn_err"
423 "vsv_make_client" "vsv_make_server" "vsv_up_connections"
424 "vsv_wait_for_done" "vsv_wait_for_input"
425 "wait_child" "wait_var"
426 ;; class methods
427 "Configure" "DisableTrigger" "DoAction" "EnableCount" "EnableTrigger"
428 "Event" "GetAssert" "GetCount" "GetFirstAssert" "GetName" "GetNextAssert"
429 "Wait"
430 "atobin" "atohex" "atoi" "atooct"
431 "backref" "bittostr" "capacity" "compare" "constraint_mode"
432 "delete"
433 "empty"
434 "find" "find_index" "first" "first_index"
435 "get_at_least" "get_auto_bin" "get_cov_weight" "get_coverage_goal"
436 "get_cross_bin_max" "get_status" "get_status_msg" "getc"
437 "hash"
438 "icompare" "insert" "inst_get_at_least" "inst_get_auto_bin_max"
439 "inst_get_collect" "inst_get_cov_weight" "inst_get_coverage_goal"
440 "inst_getcross_bin_max" "inst_query" "inst_set_at_least"
441 "inst_set_auto_bin_max" "inst_set_bin_activiation" "inst_set_collect"
442 "inst_set_cov_weight" "inst_set_coverage_goal" "inst_set_cross_bin_max"
443 "itoa"
444 "last" "last_index" "len" "load"
445 "match" "max" "max_index" "min" "min_index"
446 "object_compare" "object_copy" "object_print"
447 "pack" "pick_index" "pop_back" "pop_front" "post_pack" "post_randomize"
448 "post_unpack" "postmatch" "pre_pack" "pre_randomize" "prematch" "push_back"
449 "push_front" "putc"
450 "query" "query_str"
451 "rand_mode" "randomize" "reserve" "reverse" "rsort"
452 "search" "set_at_least" "set_auto_bin_max" "set_bin_activiation"
453 "set_cov_weight" "set_coverage_goal" "set_cross_bin_max" "set_name" "size"
454 "sort" "substr" "sum"
455 "thismatch" "tolower" "toupper"
456 "unique_index" "unpack"
457 ;; empty methods
458 "new" "object_compare"
459 "post_boundary" "post_pack" "post_randomize" "post_unpack" "pre-randomize"
460 "pre_boundary" "pre_pack" "pre_unpack"
461 )
462 "List of Vera predefined system functions, tasks and class methods.")
463
464 (defconst vera-constants
465 '(
466 "ALL" "ANY"
467 "BAD_STATE" "BAD_TRANS"
468 "CALL" "CHECK" "CHGEDGE" "CLEAR" "COPY_NO_WAIT" "COPY_WAIT"
469 "CROSS" "CROSS_TRANS"
470 "DEBUG" "DELETE"
471 "EC_ARRAYX" "EC_CODE_END" "EC_CONFLICT" "EC_EVNTIMOUT" "EC_EXPECT"
472 "EC_FULLEXPECT" "EC_MBXTMOUT" "EC_NEXPECT" "EC_RETURN" "EC_RGNTMOUT"
473 "EC_SCONFLICT" "EC_SEMTMOUT" "EC_SEXPECT" "EC_SFULLEXPECT" "EC_SNEXTPECT"
474 "EC_USERSET" "EQ" "EVENT"
475 "FAIL" "FIRST" "FORK"
476 "GE" "GOAL" "GT" "HAND_SHAKE" "HI" "HIGH" "HNUM"
477 "LE" "LIC_EXIT" "LIC_PRERR" "LIC_PRWARN" "LIC_WAIT" "LO" "LOAD" "LOW" "LT"
478 "MAILBOX" "MAX_COM"
479 "NAME" "NE" "NEGEDGE" "NEXT" "NO_OVERLAP" "NO_OVERLAP_STATE"
480 "NO_OVERLAP_TRANS" "NO_VARS" "NO_WAIT" "NUM" "NUM_BIN" "NUM_DET"
481 "OFF" "OK" "OK_LAST" "ON" "ONE_BLAST" "ONE_SHOT" "ORDER"
482 "PAST_IT" "PERCENT" "POSEDGE" "PROGRAM"
483 "RAWIN" "REGION" "REPORT"
484 "SAMPLE" "SAVE" "SEMAPHORE" "SET" "SILENT" "STATE" "STR"
485 "STR_ERR_OUT_OF_RANGE" "STR_ERR_REGEXP_SYNTAX" "SUM"
486 "TRANS"
487 "VERBOSE"
488 "WAIT"
489 "stderr" "stdin" "stdout"
490 )
491 "List of Vera predefined constants.")
492
493 (defconst vera-rvm-types
494 '(
495 "VeraListIterator_VeraListIterator_rvm_log"
496 "VeraListIterator_rvm_data" "VeraListIterator_rvm_log"
497 "VeraListNodeVeraListIterator_rvm_log" "VeraListNodervm_data"
498 "VeraListNodervm_log" "VeraList_VeraListIterator_rvm_log"
499 "VeraList_rvm_data" "VeraList_rvm_log"
500 "rvm_broadcast" "rvm_channel_class" "rvm_data" "rvm_data" "rvm_env"
501 "rvm_log" "rvm_log_modifier" "rvm_log_msg" "rvm_log_msg" "rvm_log_msg_info"
502 "rvm_log_watchpoint" "rvm_notify" "rvm_notify_event"
503 "rvm_notify_event_config" "rvm_scheduler" "rvm_scheduler_election"
504 "rvm_watchdog" "rvm_watchdog_port" "rvm_xactor" "rvm_xactor_callbacks"
505 )
506 "List of Vera-RVM keywords.")
507
508 (defconst vera-rvm-functions
509 '(
510 "extern_rvm_atomic_gen" "extern_rvm_channel" "extern_rvm_scenario_gen"
511 "rvm_OO_callback" "rvm_atomic_gen" "rvm_atomic_gen_callbacks_decl"
512 "rvm_atomic_gen_decl" "rvm_atomic_scenario_decl" "rvm_channel"
513 "rvm_channel_" "rvm_channel_decl" "rvm_command" "rvm_cycle" "rvm_debug"
514 "rvm_error" "rvm_fatal" "rvm_note" "rvm_protocol" "rvm_report"
515 "rvm_scenario_decl" "rvm_scenario_election_decl" "rvm_scenario_gen"
516 "rvm_scenario_gen_callbacks_decl" "rvm_scenario_gen_decl"
517 "rvm_trace" "rvm_transaction" "rvm_user" "rvm_verbose" "rvm_warning"
518 )
519 "List of Vera-RVM functions.")
520
521 (defconst vera-rvm-constants
522 '(
523 "RVM_NUMERIC_VERSION_MACROS" "RVM_VERSION" "RVM_MINOR" "RVM_PATCH"
524 "rvm_channel__SOURCE" "rvm_channel__SINK" "rvm_channel__NO_ACTIVE"
525 "rvm_channel__ACT_PENDING" "rvm_channel__ACT_STARTED"
526 "rvm_channel__ACT_COMPLETED" "rvm_channel__FULL" "rvm_channel__EMPTY"
527 "rvm_channel__PUT" "rvm_channel__GOT" "rvm_channel__PEEKED"
528 "rvm_channel__ACTIVATED" "rvm_channel__STARTED" "rvm_channel__COMPLETED"
529 "rvm_channel__REMOVED" "rvm_channel__LOCKED" "rvm_channel__UNLOCKED"
530 "rvm_data__EXECUTE" "rvm_data__STARTED" "rvm_data__ENDED"
531 "rvm_env__CFG_GENED" "rvm_env__BUILT" "rvm_env__DUT_CFGED"
532 "rvm_env__STARTED" "rvm_env__RESTARTED" "rvm_env__ENDED" "rvm_env__STOPPED"
533 "rvm_env__CLEANED" "rvm_env__DONE" "rvm_log__DEFAULT" "rvm_log__UNCHANGED"
534 "rvm_log__FAILURE_TYP" "rvm_log__NOTE_TYP" "rvm_log__DEBUG_TYP"
535 "rvm_log__REPORT_TYP" "rvm_log__NOTIFY_TYP" "rvm_log__TIMING_TYP"
536 "rvm_log__XHANDLING_TYP" "rvm_log__PROTOCOL_TYP" "rvm_log__TRANSACTION_TYP"
537 "rvm_log__COMMAND_TYP" "rvm_log__CYCLE_TYP" "rvm_log__USER_TYP_0"
538 "rvm_log__USER_TYP_1" "rvm_log__USER_TYP_2" "rvm_log__USER_TYP_3"
539 "rvm_log__DEFAULT_TYP" "rvm_log__ALL_TYPES" "rvm_log__FATAL_SEV"
540 "rvm_log__ERROR_SEV" "rvm_log__WARNING_SEV" "rvm_log__NORMAL_SEV"
541 "rvm_log__TRACE_SEV" "rvm_log__DEBUG_SEV" "rvm_log__VERBOSE_SEV"
542 "rvm_log__HIDDEN_SEV" "rvm_log__IGNORE_SEV" "rvm_log__DEFAULT_SEV"
543 "rvm_log__ALL_SEVERITIES" "rvm_log__CONTINUE" "rvm_log__COUNT_AS_ERROR"
544 "rvm_log__DEBUGGER" "rvm_log__DUMP" "rvm_log__STOP" "rvm_log__ABORT"
545 "rvm_notify__ONE_SHOT_TRIGGER" "rvm_notify__ONE_BLAST_TRIGGER"
546 "rvm_notify__HAND_SHAKE_TRIGGER" "rvm_notify__ON_OFF_TRIGGER"
547 "rvm_xactor__XACTOR_IDLE" "rvm_xactor__XACTOR_BUSY"
548 "rvm_xactor__XACTOR_STARTED" "rvm_xactor__XACTOR_STOPPED"
549 "rvm_xactor__XACTOR_RESET" "rvm_xactor__XACTOR_SOFT_RST"
550 "rvm_xactor__XACTOR_FIRM_RST" "rvm_xactor__XACTOR_HARD_RST"
551 "rvm_xactor__XACTOR_PROTOCOL_RST" "rvm_broadcast__AFAP"
552 "rvm_broadcast__ALAP" "rvm_watchdog__TIMEOUT"
553 "rvm_env__DUT_RESET" "rvm_log__INTERNAL_TYP"
554 "RVM_SCHEDULER_IS_XACTOR" "RVM_BROADCAST_IS_XACTOR"
555 )
556 "List of Vera-RVM predefined constants.")
557
558 ;; `regexp-opt' undefined (`xemacs-devel' not installed)
559 (unless (fboundp 'regexp-opt)
560 (defun regexp-opt (strings &optional paren)
561 (let ((open (if paren "\\(" "")) (close (if paren "\\)" "")))
562 (concat open (mapconcat 'regexp-quote strings "\\|") close))))
563
564 (defconst vera-keywords-regexp
565 (concat "\\<\\(" (regexp-opt vera-keywords) "\\)\\>")
566 "Regexp for Vera keywords.")
567
568 (defconst vera-types-regexp
569 (concat "\\<\\(" (regexp-opt vera-types) "\\)\\>")
570 "Regexp for Vera predefined types.")
571
572 (defconst vera-q-values-regexp
573 (concat "\\<\\(" (regexp-opt vera-q-values) "\\)\\>")
574 "Regexp for Vera predefined VCA q_values.")
575
576 (defconst vera-functions-regexp
577 (concat "\\<\\(" (regexp-opt vera-functions) "\\)\\>")
578 "Regexp for Vera predefined system functions, tasks and class methods.")
579
580 (defconst vera-constants-regexp
581 (concat "\\<\\(" (regexp-opt vera-constants) "\\)\\>")
582 "Regexp for Vera predefined constants.")
583
584 (defconst vera-rvm-types-regexp
585 (concat "\\<\\(" (regexp-opt vera-rvm-types) "\\)\\>")
586 "Regexp for Vera-RVM keywords.")
587
588 (defconst vera-rvm-functions-regexp
589 (concat "\\<\\(" (regexp-opt vera-rvm-functions) "\\)\\>")
590 "Regexp for Vera-RVM predefined system functions, tasks and class methods.")
591
592 (defconst vera-rvm-constants-regexp
593 (concat "\\<\\(" (regexp-opt vera-rvm-constants) "\\)\\>")
594 "Regexp for Vera-RVM predefined constants.")
595
596
597 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
598 ;;; Font locking
599 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
600
601 ;; XEmacs compatibility
602 (when vera-xemacs
603 (require 'font-lock)
604 (copy-face 'font-lock-reference-face 'font-lock-constant-face)
605 (copy-face 'font-lock-preprocessor-face 'font-lock-builtin-face))
606
607 (defun vera-font-lock-match-item (limit)
608 "Match, and move over, any declaration item after point. Adapted from
609 `font-lock-match-c-style-declaration-item-and-skip-to-next'."
610 (condition-case nil
611 (save-restriction
612 (narrow-to-region (point-min) limit)
613 ;; match item
614 (when (looking-at "\\s-*\\(\\w+\\)")
615 (save-match-data
616 (goto-char (match-end 1))
617 ;; move to next item
618 (if (looking-at "\\(\\s-*\\(\\[[^]]*\\]\\s-*\\)?,\\)")
619 (goto-char (match-end 1))
620 (end-of-line) t))))
621 (error t)))
622
623 (defvar vera-font-lock-keywords
624 (list
625 ;; highlight keywords
626 (list vera-keywords-regexp 1 'font-lock-keyword-face)
627 ;; highlight types
628 (list vera-types-regexp 1 'font-lock-type-face)
629 ;; highlight RVM types
630 (list vera-rvm-types-regexp 1 'font-lock-type-face)
631 ;; highlight constants
632 (list vera-constants-regexp 1 'font-lock-constant-face)
633 ;; highlight RVM constants
634 (list vera-rvm-constants-regexp 1 'font-lock-constant-face)
635 ;; highlight q_values
636 (list vera-q-values-regexp 1 'font-lock-constant-face)
637 ;; highlight predefined functions, tasks and methods
638 (list vera-functions-regexp 1 'vera-font-lock-function)
639 ;; highlight predefined RVM functions
640 (list vera-rvm-functions-regexp 1 'vera-font-lock-function)
641 ;; highlight functions
642 '("\\<\\(\\w+\\)\\s-*(" 1 font-lock-function-name-face)
643 ;; highlight various declaration names
644 '("^\\s-*\\(port\\|program\\|task\\)\\s-+\\(\\w+\\)\\>"
645 2 font-lock-function-name-face)
646 '("^\\s-*bind\\s-+\\(\\w+\\)\\s-+\\(\\w+\\)\\>"
647 (1 font-lock-function-name-face) (2 font-lock-function-name-face))
648 ;; highlight interface declaration names
649 '("^\\s-*\\(class\\|interface\\)\\s-+\\(\\w+\\)\\>"
650 2 vera-font-lock-interface)
651 ;; highlight variable name definitions
652 (list (concat "^\\s-*" vera-types-regexp "\\s-*\\(\\[[^]]+\\]\\s-+\\)?")
653 '(vera-font-lock-match-item nil nil (1 font-lock-variable-name-face)))
654 (list (concat "^\\s-*" vera-rvm-types-regexp "\\s-*\\(\\[[^]]+\\]\\s-+\\)?")
655 '(vera-font-lock-match-item nil nil (1 font-lock-variable-name-face)))
656 ;; highlight numbers
657 '("\\([0-9]*'[bdoh][0-9a-fA-FxXzZ_]+\\)" 1 vera-font-lock-number)
658 ;; highlight filenames in #include directives
659 '("^#\\s-*include\\s-*\\(<[^>\"\n]*>?\\)"
660 1 font-lock-string-face)
661 ;; highlight directives and directive names
662 '("^#\\s-*\\(\\w+\\)\\>[ \t!]*\\(\\w+\\)?"
663 (1 font-lock-builtin-face) (2 font-lock-variable-name-face nil t))
664 ;; highlight `@', `$' and `#'
665 '("\\([@$#]\\)" 1 font-lock-keyword-face)
666 ;; highlight @ and # definitions
667 '("@\\s-*\\(\\w*\\)\\(\\s-*,\\s-*\\(\\w+\\)\\)?\\>[^.]"
668 (1 vera-font-lock-number) (3 vera-font-lock-number nil t))
669 ;; highlight interface signal name
670 '("\\(\\w+\\)\\.\\w+" 1 vera-font-lock-interface)
671 )
672 "Regular expressions to highlight in Vera Mode.")
673
674 (defvar vera-font-lock-number 'vera-font-lock-number
675 "Face name to use for @ definitions.")
676
677 (defvar vera-font-lock-function 'vera-font-lock-function
678 "Face name to use for predefined functions and tasks.")
679
680 (defvar vera-font-lock-interface 'vera-font-lock-interface
681 "Face name to use for interface names.")
682
683 (defface vera-font-lock-number
684 '((((class color) (background light)) (:foreground "Gold4"))
685 (((class color) (background dark)) (:foreground "BurlyWood1"))
686 (t (:italic t :bold t)))
687 "Font lock mode face used to highlight @ definitions."
688 :group 'font-lock-highlighting-faces)
689 (put 'vera-font-lock-number-face 'face-alias 'vera-font-lock-number)
690
691 (defface vera-font-lock-function
692 '((((class color) (background light)) (:foreground "DarkCyan"))
693 (((class color) (background dark)) (:foreground "Orchid1"))
694 (t (:italic t :bold t)))
695 "Font lock mode face used to highlight predefined functions and tasks."
696 :group 'font-lock-highlighting-faces)
697 (put 'vera-font-lock-function-face 'face-alias 'vera-font-lock-function)
698
699 (defface vera-font-lock-interface
700 '((((class color) (background light)) (:foreground "Grey40"))
701 (((class color) (background dark)) (:foreground "Grey80"))
702 (t (:italic t :bold t)))
703 "Font lock mode face used to highlight interface names."
704 :group 'font-lock-highlighting-faces)
705 (put 'vera-font-lock-interface-face 'face-alias 'vera-font-lock-interface)
706
707 (defun vera-fontify-buffer ()
708 "Fontify buffer."
709 (interactive)
710 (font-lock-fontify-buffer))
711
712
713 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
714 ;;; Indentation
715 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
716
717 (defvar vera-echo-syntactic-information-p nil
718 "If non-nil, syntactic info is echoed when the line is indented.")
719
720 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
721 ;; offset functions
722
723 (defconst vera-offsets-alist
724 '((comment . vera-lineup-C-comments)
725 (comment-intro . vera-lineup-comment)
726 (string . -1000)
727 (directive . -1000)
728 (block-open . 0)
729 (block-intro . +)
730 (block-close . 0)
731 (arglist-intro . +)
732 (arglist-cont . +)
733 (arglist-cont-nonempty . 0)
734 (arglist-close . 0)
735 (statement . 0)
736 (statement-cont . +)
737 (substatement . +)
738 (else-clause . 0))
739 "Association list of syntactic element symbols and indentation offsets.
740 Adapted from `c-offsets-alist'.")
741
742 (defun vera-evaluate-offset (offset langelem symbol)
743 "OFFSET can be a number, a function, a variable, a list, or one of
744 the symbols + or -."
745 (cond
746 ((eq offset '+) (setq offset vera-basic-offset))
747 ((eq offset '-) (setq offset (- vera-basic-offset)))
748 ((eq offset '++) (setq offset (* 2 vera-basic-offset)))
749 ((eq offset '--) (setq offset (* 2 (- vera-basic-offset))))
750 ((eq offset '*) (setq offset (/ vera-basic-offset 2)))
751 ((eq offset '/) (setq offset (/ (- vera-basic-offset) 2)))
752 ((functionp offset) (setq offset (funcall offset langelem)))
753 ((listp offset)
754 (setq offset
755 (let (done)
756 (while (and (not done) offset)
757 (setq done (vera-evaluate-offset (car offset) langelem symbol)
758 offset (cdr offset)))
759 (if (not done)
760 0
761 done))))
762 ((not (numberp offset)) (setq offset (symbol-value offset))))
763 offset)
764
765 (defun vera-get-offset (langelem)
766 "Get offset from LANGELEM which is a cons cell of the form:
767 \(SYMBOL . RELPOS). The symbol is matched against
768 vera-offsets-alist and the offset found there is either returned,
769 or added to the indentation at RELPOS. If RELPOS is nil, then
770 the offset is simply returned."
771 (let* ((symbol (car langelem))
772 (relpos (cdr langelem))
773 (match (assq symbol vera-offsets-alist))
774 (offset (cdr-safe match)))
775 (if (not match)
776 (setq offset 0
777 relpos 0)
778 (setq offset (vera-evaluate-offset offset langelem symbol)))
779 (+ (if (and relpos
780 (< relpos (save-excursion (beginning-of-line) (point))))
781 (save-excursion
782 (goto-char relpos)
783 (current-column))
784 0)
785 (vera-evaluate-offset offset langelem symbol))))
786
787 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
788 ;; help functions
789
790 (defsubst vera-point (position)
791 "Returns the value of point at certain commonly referenced POSITIONs.
792 POSITION can be one of the following symbols:
793 bol -- beginning of line
794 eol -- end of line
795 boi -- back to indentation
796 ionl -- indentation of next line
797 iopl -- indentation of previous line
798 bonl -- beginning of next line
799 bopl -- beginning of previous line
800 This function does not modify point or mark."
801 (save-excursion
802 (cond
803 ((eq position 'bol) (beginning-of-line))
804 ((eq position 'eol) (end-of-line))
805 ((eq position 'boi) (back-to-indentation))
806 ((eq position 'bonl) (forward-line 1))
807 ((eq position 'bopl) (forward-line -1))
808 ((eq position 'iopl) (forward-line -1) (back-to-indentation))
809 ((eq position 'ionl) (forward-line 1) (back-to-indentation))
810 (t (error "Unknown buffer position requested: %s" position)))
811 (point)))
812
813 (defun vera-in-literal (&optional lim)
814 "Determine if point is in a Vera literal."
815 (save-excursion
816 (let ((state (parse-partial-sexp (or lim (point-min)) (point))))
817 (cond
818 ((nth 3 state) 'string)
819 ((nth 4 state) 'comment)
820 (t nil)))))
821
822 (defun vera-in-comment-p ()
823 "Determine if point is in a Vera comment."
824 (save-excursion
825 (re-search-backward "\\(/\\*\\)\\|\\(\\*/\\)" nil t)
826 (match-string 1)))
827
828 (defun vera-skip-forward-literal ()
829 "Skip forward literal and return t if within one."
830 (let ((state (save-excursion (parse-partial-sexp (point-min) (point)))))
831 (cond
832 ((nth 3 state) (search-forward "\"") t) ; inside string
833 ((nth 7 state) (forward-line 1) t) ; inside // comment
834 ((nth 4 state) (search-forward "*/") t) ; inside /* */ comment
835 (t nil))))
836
837 (defun vera-skip-backward-literal ()
838 "Skip backward literal and return t if within one."
839 (let ((state (save-excursion (parse-partial-sexp (point-min) (point)))))
840 (cond
841 ((nth 3 state) (search-backward "\"") t) ; inside string
842 ((nth 7 state) (search-backward "//") t) ; inside // comment
843 ((nth 4 state) (search-backward "/*") t) ; inside /* */ comment
844 (t nil))))
845
846 (defsubst vera-re-search-forward (regexp &optional bound noerror)
847 "Like `re-search-forward', but skips over matches in literals."
848 (store-match-data '(nil nil))
849 (while (and (re-search-forward regexp bound noerror)
850 (vera-skip-forward-literal)
851 (progn (store-match-data '(nil nil))
852 (if bound (< (point) bound) t))))
853 (match-end 0))
854
855 (defsubst vera-re-search-backward (regexp &optional bound noerror)
856 "Like `re-search-backward', but skips over matches in literals."
857 (store-match-data '(nil nil))
858 (while (and (re-search-backward regexp bound noerror)
859 (vera-skip-backward-literal)
860 (progn (store-match-data '(nil nil))
861 (if bound (> (point) bound) t))))
862 (match-end 0))
863
864 (defun vera-forward-syntactic-ws (&optional lim skip-directive)
865 "Forward skip of syntactic whitespace."
866 (save-restriction
867 (let* ((lim (or lim (point-max)))
868 (here lim)
869 (hugenum (point-max)))
870 (narrow-to-region lim (point))
871 (while (/= here (point))
872 (setq here (point))
873 (forward-comment hugenum)
874 (when (and skip-directive (looking-at "^\\s-*#"))
875 (end-of-line))))))
876
877 (defun vera-backward-syntactic-ws (&optional lim skip-directive)
878 "Backward skip over syntactic whitespace."
879 (save-restriction
880 (let* ((lim (or lim (point-min)))
881 (here lim)
882 (hugenum (- (point-max))))
883 (when (< lim (point))
884 (narrow-to-region lim (point))
885 (while (/= here (point))
886 (setq here (point))
887 (forward-comment hugenum)
888 (when (and skip-directive
889 (save-excursion (back-to-indentation)
890 (= (following-char) ?\#)))
891 (beginning-of-line)))))))
892
893 (defmacro vera-prepare-search (&rest body)
894 "Switch to syntax table that includes '_', then execute BODY, and finally
895 restore the old environment. Used for consistent searching."
896 `(let ((current-syntax-table (syntax-table))
897 result
898 (restore-prog ; program to restore enviroment
899 '(progn
900 ;; restore syntax table
901 (set-syntax-table current-syntax-table))))
902 ;; use extended syntax table
903 (set-syntax-table vera-mode-ext-syntax-table)
904 ;; execute BODY safely
905 (setq result
906 (condition-case info
907 (progn ,@body)
908 (error (eval restore-prog) ; restore environment on error
909 (error (cadr info))))) ; pass error up
910 ;; restore environment
911 (eval restore-prog)
912 result))
913
914 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
915 ;; comment indentation functions
916
917 (defsubst vera-langelem-col (langelem &optional preserve-point)
918 "Convenience routine to return the column of LANGELEM's relpos.
919 Leaves point at the relpos unless PRESERVE-POINT is non-nil."
920 (let ((here (point)))
921 (goto-char (cdr langelem))
922 (prog1 (current-column)
923 (if preserve-point
924 (goto-char here)))))
925
926 (defun vera-lineup-C-comments (langelem)
927 "Line up C block comment continuation lines.
928 Nicked from `c-lineup-C-comments'."
929 (save-excursion
930 (let ((here (point))
931 (stars (progn (back-to-indentation)
932 (skip-chars-forward "*")))
933 (langelem-col (vera-langelem-col langelem)))
934 (back-to-indentation)
935 (if (not (re-search-forward "/\\([*]+\\)" (vera-point 'eol) t))
936 (progn
937 (if (not (looking-at "[*]+"))
938 (progn
939 ;; we now have to figure out where this comment begins.
940 (goto-char here)
941 (back-to-indentation)
942 (if (looking-at "[*]+/")
943 (progn (goto-char (match-end 0))
944 (forward-comment -1))
945 (goto-char (cdr langelem))
946 (back-to-indentation))))
947 (- (current-column) langelem-col))
948 (if (zerop stars)
949 (progn
950 (skip-chars-forward " \t")
951 (- (current-column) langelem-col))
952 ;; how many stars on comment opening line? if greater than
953 ;; on current line, align left. if less than or equal,
954 ;; align right. this should also pick up Javadoc style
955 ;; comments.
956 (if (> (length (match-string 1)) stars)
957 (progn
958 (back-to-indentation)
959 (- (current-column) -1 langelem-col))
960 (- (current-column) stars langelem-col)))))))
961
962 (defun vera-lineup-comment (langelem)
963 "Line up a comment start."
964 (save-excursion
965 (back-to-indentation)
966 (if (bolp)
967 ;; not indent if at beginning of line
968 -1000
969 ;; otherwise indent accordingly
970 (goto-char (cdr langelem))
971 (current-column))))
972
973 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
974 ;; move functions
975
976 (defconst vera-beg-block-re "{\\|\\<\\(begin\\|fork\\)\\>")
977
978 (defconst vera-end-block-re "}\\|\\<\\(end\\|join\\(\\s-+\\(all\\|any\\|none\\)\\)?\\)\\>")
979
980 (defconst vera-beg-substatement-re "\\<\\(else\\|for\\|if\\|repeat\\|while\\)\\>")
981
982 (defun vera-corresponding-begin (&optional recursive)
983 "Find corresponding block begin if cursor is at a block end."
984 (while (and (vera-re-search-backward
985 (concat "\\(" vera-end-block-re "\\)\\|" vera-beg-block-re)
986 nil t)
987 (match-string 1))
988 (vera-corresponding-begin t))
989 (unless recursive (vera-beginning-of-substatement)))
990
991 (defun vera-corresponding-if ()
992 "Find corresponding `if' if cursor is at `else'."
993 (while (and (vera-re-search-backward "}\\|\\<\\(if\\|else\\)\\>" nil t)
994 (not (equal (match-string 0) "if")))
995 (if (equal (match-string 0) "else")
996 (vera-corresponding-if)
997 (forward-char)
998 (backward-sexp))))
999
1000 (defun vera-beginning-of-statement ()
1001 "Go to beginning of current statement."
1002 (let (pos)
1003 (while
1004 (progn
1005 ;; search for end of previous statement
1006 (while
1007 (and (vera-re-search-backward
1008 (concat "[);]\\|" vera-beg-block-re
1009 "\\|" vera-end-block-re) nil t)
1010 (equal (match-string 0) ")"))
1011 (forward-char)
1012 (backward-sexp))
1013 (setq pos (match-beginning 0))
1014 ;; go back to beginning of current statement
1015 (goto-char (or (match-end 0) 0))
1016 (vera-forward-syntactic-ws nil t)
1017 (when (looking-at "(")
1018 (forward-sexp)
1019 (vera-forward-syntactic-ws nil t))
1020 ;; if "else" found, go to "if" and search again
1021 (when (looking-at "\\<else\\>")
1022 (vera-corresponding-if)
1023 (setq pos (point))
1024 t))
1025 ;; if search is repeated, go to beginning of last search
1026 (goto-char pos))))
1027
1028 (defun vera-beginning-of-substatement ()
1029 "Go to beginning of current substatement."
1030 (let ((lim (point))
1031 pos)
1032 ;; go to beginning of statement
1033 (vera-beginning-of-statement)
1034 (setq pos (point))
1035 ;; go forward all substatement opening statements until at LIM
1036 (while (and (< (point) lim)
1037 (vera-re-search-forward vera-beg-substatement-re lim t))
1038 (setq pos (match-beginning 0)))
1039 (vera-forward-syntactic-ws nil t)
1040 (when (looking-at "(")
1041 (forward-sexp)
1042 (vera-forward-syntactic-ws nil t))
1043 (when (< (point) lim)
1044 (setq pos (point)))
1045 (goto-char pos)))
1046
1047 (defun vera-forward-statement ()
1048 "Move forward one statement."
1049 (interactive)
1050 (vera-prepare-search
1051 (while (and (vera-re-search-forward
1052 (concat "[(;]\\|" vera-beg-block-re "\\|" vera-end-block-re)
1053 nil t)
1054 (equal (match-string 0) "("))
1055 (backward-char)
1056 (forward-sexp))
1057 (vera-beginning-of-substatement)))
1058
1059 (defun vera-backward-statement ()
1060 "Move backward one statement."
1061 (interactive)
1062 (vera-prepare-search
1063 (vera-backward-syntactic-ws nil t)
1064 (unless (= (preceding-char) ?\))
1065 (backward-char))
1066 (vera-beginning-of-substatement)))
1067
1068 (defun vera-forward-same-indent ()
1069 "Move forward to next line with same indent."
1070 (interactive)
1071 (let ((pos (point))
1072 (indent (current-indentation)))
1073 (beginning-of-line 2)
1074 (while (and (not (eobp))
1075 (or (looking-at "^\\s-*$")
1076 (> (current-indentation) indent)))
1077 (beginning-of-line 2))
1078 (if (= (current-indentation) indent)
1079 (back-to-indentation)
1080 (message "No following line with same indent found in this block")
1081 (goto-char pos))))
1082
1083 (defun vera-backward-same-indent ()
1084 "Move backward to previous line with same indent."
1085 (interactive)
1086 (let ((pos (point))
1087 (indent (current-indentation)))
1088 (beginning-of-line -0)
1089 (while (and (not (bobp))
1090 (or (looking-at "^\\s-*$")
1091 (> (current-indentation) indent)))
1092 (beginning-of-line -0))
1093 (if (= (current-indentation) indent)
1094 (back-to-indentation)
1095 (message "No preceding line with same indent found in this block")
1096 (goto-char pos))))
1097
1098 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1099 ;; syntax analysis
1100
1101 (defmacro vera-add-syntax (symbol &optional relpos)
1102 "A simple macro to append the syntax in SYMBOL to the syntax list.
1103 try to increase performance by using this macro."
1104 `(setq syntax (cons (cons ,symbol ,(or relpos 0)) syntax)))
1105
1106 (defun vera-guess-basic-syntax ()
1107 "Determine syntactic context of current line of code."
1108 (save-excursion
1109 (beginning-of-line)
1110 (let ((indent-point (point))
1111 syntax state placeholder pos)
1112 ;; determine syntax state
1113 (setq state (parse-partial-sexp (point-min) (point)))
1114 (cond
1115 ;; CASE 1: in a comment?
1116 ((nth 4 state)
1117 ;; skip empty lines
1118 (while (and (zerop (forward-line -1))
1119 (looking-at "^\\s-*$")))
1120 (vera-add-syntax 'comment (vera-point 'boi)))
1121 ;; CASE 2: in a string?
1122 ((nth 3 state)
1123 (vera-add-syntax 'string))
1124 ;; CASE 3: at a directive?
1125 ((save-excursion (back-to-indentation) (= (following-char) ?\#))
1126 (vera-add-syntax 'directive (point)))
1127 ;; CASE 4: after an opening parenthesis (argument list continuation)?
1128 ((and (nth 1 state)
1129 (or (= (char-after (nth 1 state)) ?\()
1130 ;; also for concatenation (opening '{' and ',' on eol/eopl)
1131 (and (= (char-after (nth 1 state)) ?\{)
1132 (or (save-excursion
1133 (vera-backward-syntactic-ws) (= (char-before) ?,))
1134 (save-excursion
1135 (end-of-line) (= (char-before) ?,))))))
1136 (goto-char (1+ (nth 1 state)))
1137 ;; is there code after the opening parenthesis on the same line?
1138 (if (looking-at "\\s-*$")
1139 (vera-add-syntax 'arglist-cont (vera-point 'boi))
1140 (vera-add-syntax 'arglist-cont-nonempty (point))))
1141 ;; CASE 5: at a block closing?
1142 ((save-excursion (back-to-indentation) (looking-at vera-end-block-re))
1143 ;; look for the corresponding begin
1144 (vera-corresponding-begin)
1145 (vera-add-syntax 'block-close (vera-point 'boi)))
1146 ;; CASE 6: at a block intro (the first line after a block opening)?
1147 ((and (save-excursion
1148 (vera-backward-syntactic-ws nil t)
1149 ;; previous line ends with a block opening?
1150 (or (/= (skip-chars-backward "{") 0) (backward-word 1))
1151 (when (looking-at vera-beg-block-re)
1152 ;; go to beginning of substatement
1153 (vera-beginning-of-substatement)
1154 (setq placeholder (point))))
1155 ;; not if "fork" is followed by "{"
1156 (save-excursion
1157 (not (and (progn (back-to-indentation) (looking-at "{"))
1158 (progn (goto-char placeholder)
1159 (looking-at "\\<fork\\>"))))))
1160 (goto-char placeholder)
1161 (vera-add-syntax 'block-intro (vera-point 'boi)))
1162 ;; CASE 7: at the beginning of an else clause?
1163 ((save-excursion (back-to-indentation) (looking-at "\\<else\\>"))
1164 ;; find corresponding if
1165 (vera-corresponding-if)
1166 (vera-add-syntax 'else-clause (vera-point 'boi)))
1167 ;; CASE 8: at the beginning of a statement?
1168 ;; is the previous command completed?
1169 ((or (save-excursion
1170 (vera-backward-syntactic-ws nil t)
1171 (setq placeholder (point))
1172 ;; at the beginning of the buffer?
1173 (or (bobp)
1174 ;; previous line ends with a semicolon or
1175 ;; is a block opening or closing?
1176 (when (or (/= (skip-chars-backward "{};") 0)
1177 (progn (back-to-indentation)
1178 (looking-at (concat vera-beg-block-re "\\|"
1179 vera-end-block-re))))
1180 ;; if at a block closing, go to beginning
1181 (when (looking-at vera-end-block-re)
1182 (vera-corresponding-begin))
1183 ;; go to beginning of the statement
1184 (vera-beginning-of-statement)
1185 (setq placeholder (point)))
1186 ;; at a directive?
1187 (when (progn (back-to-indentation) (looking-at "#"))
1188 ;; go to previous statement
1189 (vera-beginning-of-statement)
1190 (setq placeholder (point)))))
1191 ;; at a block opening?
1192 (when (save-excursion (back-to-indentation)
1193 (looking-at vera-beg-block-re))
1194 ;; go to beginning of the substatement
1195 (vera-beginning-of-substatement)
1196 (setq placeholder (point))))
1197 (goto-char placeholder)
1198 (vera-add-syntax 'statement (vera-point 'boi)))
1199 ;; CASE 9: at the beginning of a substatement?
1200 ;; is this line preceeded by a substatement opening statement?
1201 ((save-excursion (vera-backward-syntactic-ws nil t)
1202 (when (= (preceding-char) ?\)) (backward-sexp))
1203 (backward-word 1)
1204 (setq placeholder (point))
1205 (looking-at vera-beg-substatement-re))
1206 (goto-char placeholder)
1207 (vera-add-syntax 'substatement (vera-point 'boi)))
1208 ;; CASE 10: it must be a statement continuation!
1209 (t
1210 ;; go to beginning of statement
1211 (vera-beginning-of-substatement)
1212 (vera-add-syntax 'statement-cont (vera-point 'boi))))
1213 ;; special case: look for a comment start
1214 (goto-char indent-point)
1215 (skip-chars-forward " \t")
1216 (when (looking-at comment-start)
1217 (vera-add-syntax 'comment-intro))
1218 ;; return syntax
1219 syntax)))
1220
1221 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1222 ;; indentation functions
1223
1224 (defun vera-indent-line ()
1225 "Indent the current line as Vera code. Optional SYNTAX is the
1226 syntactic information for the current line. Returns the amount of
1227 indentation change (in columns)."
1228 (interactive)
1229 (vera-prepare-search
1230 (let* ((syntax (vera-guess-basic-syntax))
1231 (pos (- (point-max) (point)))
1232 (indent (apply '+ (mapcar 'vera-get-offset syntax)))
1233 (shift-amt (- (current-indentation) indent)))
1234 (when vera-echo-syntactic-information-p
1235 (message "syntax: %s, indent= %d" syntax indent))
1236 (unless (zerop shift-amt)
1237 (beginning-of-line)
1238 (delete-region (point) (vera-point 'boi))
1239 (indent-to indent))
1240 (if (< (point) (vera-point 'boi))
1241 (back-to-indentation)
1242 ;; If initial point was within line's indentation, position after
1243 ;; the indentation. Else stay at same point in text.
1244 (when (> (- (point-max) pos) (point))
1245 (goto-char (- (point-max) pos))))
1246 shift-amt)))
1247
1248 (defun vera-indent-buffer ()
1249 "Indent whole buffer as Vera code.
1250 Calls `indent-region' for whole buffer."
1251 (interactive)
1252 (message "Indenting buffer...")
1253 (indent-region (point-min) (point-max) nil)
1254 (message "Indenting buffer...done"))
1255
1256 (defun vera-indent-region (start end column)
1257 "Indent region as Vera code."
1258 (interactive "r\nP")
1259 (message "Indenting region...")
1260 (indent-region start end column)
1261 (message "Indenting region...done"))
1262
1263 (defsubst vera-indent-block-closing ()
1264 "If previous word is a block closing or `else', indent line again."
1265 (when (= (char-syntax (preceding-char)) ?w)
1266 (save-excursion
1267 (backward-word 1)
1268 (when (and (not (vera-in-literal))
1269 (looking-at (concat vera-end-block-re "\\|\\<else\\>")))
1270 (indent-according-to-mode)))))
1271
1272 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1273 ;; electrifications
1274
1275 (defun vera-electric-tab (&optional prefix-arg)
1276 "If preceeding character is part of a word or a paren then hippie-expand,
1277 else if right of non whitespace on line then tab-to-tab-stop,
1278 else if last command was a tab or return then dedent one step or if a comment
1279 toggle between normal indent and inline comment indent,
1280 else indent `correctly'.
1281 If `vera-intelligent-tab' is nil, always indent line."
1282 (interactive "*P")
1283 (if vera-intelligent-tab
1284 (progn
1285 (cond ((memq (char-syntax (preceding-char)) '(?w ?_))
1286 (let ((case-fold-search t)
1287 (case-replace nil)
1288 (hippie-expand-only-buffers
1289 (or (and (boundp 'hippie-expand-only-buffers)
1290 hippie-expand-only-buffers)
1291 '(vera-mode))))
1292 (vera-expand-abbrev prefix-arg)))
1293 ((> (current-column) (current-indentation))
1294 (tab-to-tab-stop))
1295 ((and (or (eq last-command 'vera-electric-tab)
1296 (eq last-command 'vera-electric-return))
1297 (/= 0 (current-indentation)))
1298 (backward-delete-char-untabify vera-basic-offset nil))
1299 (t (indent-according-to-mode)))
1300 (setq this-command 'vera-electric-tab))
1301 (indent-according-to-mode)))
1302
1303 (defun vera-electric-return ()
1304 "Insert newline and indent. Indent current line if it is a block closing."
1305 (interactive)
1306 (vera-indent-block-closing)
1307 (newline-and-indent))
1308
1309 (defun vera-electric-space (arg)
1310 "Insert a space. Indent current line if it is a block closing."
1311 (interactive "*P")
1312 (unless arg
1313 (vera-indent-block-closing))
1314 (self-insert-command (prefix-numeric-value arg)))
1315
1316 (defun vera-electric-opening-brace (arg)
1317 "Outdent opening brace."
1318 (interactive "*P")
1319 (self-insert-command (prefix-numeric-value arg))
1320 (unless arg
1321 (indent-according-to-mode)))
1322
1323 (defun vera-electric-closing-brace (arg)
1324 "Outdent closing brace."
1325 (interactive "*P")
1326 (self-insert-command (prefix-numeric-value arg))
1327 (unless arg
1328 (indent-according-to-mode)))
1329
1330 (defun vera-electric-pound (arg)
1331 "Insert `#' and indent as directive it first character of line."
1332 (interactive "*P")
1333 (self-insert-command (prefix-numeric-value arg))
1334 (unless arg
1335 (save-excursion
1336 (backward-char)
1337 (skip-chars-backward " \t")
1338 (when (bolp)
1339 (delete-horizontal-space)))))
1340
1341 (defun vera-electric-star (arg)
1342 "Insert a star character. Nicked from `c-electric-star'."
1343 (interactive "*P")
1344 (self-insert-command (prefix-numeric-value arg))
1345 (if (and (not arg)
1346 (memq (vera-in-literal) '(comment))
1347 (eq (char-before) ?*)
1348 (save-excursion
1349 (forward-char -1)
1350 (skip-chars-backward "*")
1351 (if (eq (char-before) ?/)
1352 (forward-char -1))
1353 (skip-chars-backward " \t")
1354 (bolp)))
1355 (indent-according-to-mode)))
1356
1357 (defun vera-electric-slash (arg)
1358 "Insert a slash character. Nicked from `c-electric-slash'."
1359 (interactive "*P")
1360 (let* ((ch (char-before))
1361 (indentp (and (not arg)
1362 (eq last-command-char ?/)
1363 (or (and (eq ch ?/)
1364 (not (vera-in-literal)))
1365 (and (eq ch ?*)
1366 (vera-in-literal))))))
1367 (self-insert-command (prefix-numeric-value arg))
1368 (when indentp
1369 (indent-according-to-mode))))
1370
1371
1372 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1373 ;;; Miscellaneous
1374 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1375
1376 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1377 ;; Hippie expand customization (for expansion of Vera commands)
1378
1379 (defvar vera-abbrev-list
1380 (append (list nil) vera-keywords
1381 (list nil) vera-types
1382 (list nil) vera-functions
1383 (list nil) vera-constants
1384 (list nil) vera-rvm-types
1385 (list nil) vera-rvm-functions
1386 (list nil) vera-rvm-constants)
1387 "Predefined abbreviations for Vera.")
1388
1389 (defvar vera-expand-upper-case nil)
1390
1391 (eval-when-compile (require 'hippie-exp))
1392
1393 (defun vera-try-expand-abbrev (old)
1394 "Try expanding abbreviations from `vera-abbrev-list'."
1395 (unless old
1396 (he-init-string (he-dabbrev-beg) (point))
1397 (setq he-expand-list
1398 (let ((abbrev-list vera-abbrev-list)
1399 (sel-abbrev-list '()))
1400 (while abbrev-list
1401 (when (or (not (stringp (car abbrev-list)))
1402 (string-match
1403 (concat "^" he-search-string) (car abbrev-list)))
1404 (setq sel-abbrev-list
1405 (cons (car abbrev-list) sel-abbrev-list)))
1406 (setq abbrev-list (cdr abbrev-list)))
1407 (nreverse sel-abbrev-list))))
1408 (while (and he-expand-list
1409 (or (not (stringp (car he-expand-list)))
1410 (he-string-member (car he-expand-list) he-tried-table t)))
1411 (unless (stringp (car he-expand-list))
1412 (setq vera-expand-upper-case (car he-expand-list)))
1413 (setq he-expand-list (cdr he-expand-list)))
1414 (if (null he-expand-list)
1415 (progn (when old (he-reset-string))
1416 nil)
1417 (he-substitute-string
1418 (if vera-expand-upper-case
1419 (upcase (car he-expand-list))
1420 (car he-expand-list))
1421 t)
1422 (setq he-expand-list (cdr he-expand-list))
1423 t))
1424
1425 ;; function for expanding abbrevs and dabbrevs
1426 (defun vera-expand-abbrev (arg))
1427 (fset 'vera-expand-abbrev (make-hippie-expand-function
1428 '(try-expand-dabbrev
1429 try-expand-dabbrev-all-buffers
1430 vera-try-expand-abbrev)))
1431
1432 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1433 ;; Comments
1434
1435 (defun vera-comment-uncomment-region (beg end &optional arg)
1436 "Comment region if not commented, uncomment region if already commented."
1437 (interactive "r\nP")
1438 (goto-char beg)
1439 (if (looking-at (regexp-quote comment-start))
1440 (comment-region beg end '(4))
1441 (comment-region beg end)))
1442
1443 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1444 ;; Help functions
1445
1446 (defun vera-customize ()
1447 "Call the customize function with `vera' as argument."
1448 (interactive)
1449 (customize-group 'vera))
1450
1451 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1452 ;; Other
1453
1454 ;; remove ".vr" from `completion-ignored-extensions'
1455 (setq completion-ignored-extensions
1456 (delete ".vr" completion-ignored-extensions))
1457
1458
1459 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1460 ;;; Bug reports
1461 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1462
1463 (defconst vera-mode-help-address "Reto Zimmermann <reto@gnu.org>"
1464 "Address for Vera Mode bug reports.")
1465
1466 ;; get reporter-submit-bug-report when byte-compiling
1467 (eval-when-compile
1468 (require 'reporter))
1469
1470 (defun vera-submit-bug-report ()
1471 "Submit via mail a bug report on Vera Mode."
1472 (interactive)
1473 ;; load in reporter
1474 (and
1475 (y-or-n-p "Do you want to submit a report on Vera Mode? ")
1476 (require 'reporter)
1477 (let ((reporter-prompt-for-summary-p t))
1478 (reporter-submit-bug-report
1479 vera-mode-help-address
1480 (concat "Vera Mode " vera-version)
1481 (list
1482 ;; report all important variables
1483 'vera-basic-offset
1484 'vera-underscore-is-part-of-word
1485 'vera-intelligent-tab
1486 )
1487 nil nil
1488 "Hi Reto,"))))
1489
1490
1491 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1492 ;;; Documentation
1493 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1494
1495 (defun vera-version ()
1496 "Echo the current version of Vera Mode in the minibuffer."
1497 (interactive)
1498 (message "Vera Mode %s (%s)" vera-version vera-time-stamp))
1499
1500
1501 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1502
1503 (provide 'vera-mode)
1504
1505 ;;; vera-mode.el ends here