Lines Matching +defs:dol +defs:parse +defs:error
2 (autoload 'turn-on-dol-indent "dol-indent" "Turn on DOL indentation." t)
12 (defconst dol-mode-version "0.4"
15 (defgroup dol nil
18 :prefix "dol-")
21 (defvar dol-mode-hook nil)
22 (defvar dol-mode-map (let ((keymap (make-keymap)))
23 (define-key keymap "\C-c\C-r" 'dol-run-hets-r)
25 (define-key keymap "\C-c\C-u" 'dol-run-hets-g)
26 (define-key keymap "\C-c\C-c" 'dol-run-hets-g))
27 (define-key keymap "\C-c\C-n" 'dol-compile-goto-next-error)
32 (defvar dol-running-xemacs
38 (defvar dol-mode-syntax-table nil
41 (if dol-mode-syntax-table
74 (setq dol-mode-syntax-table table))
78 (defun dol-vars ()
89 (setq comment-indent-function 'dol-comment-indent)
96 (defun dol-comment-indent ()
103 (defface dol-black-komma-face
108 (defface dol-blue-komma-face
113 (defvar dol-black-komma-face 'dol-black-komma-face
116 (defvar dol-annotation-face 'dol-annotation-face
118 (setq dol-annotation-face 'font-lock-constant-face)
120 (defvar dol-name-face 'dol-name-face)
121 (setq dol-name-face 'font-lock-variable-name-face)
123 (defvar dol-keyword-face 'dol-keyword-face)
124 (setq dol-keyword-face 'font-lock-keyword-face)
126 (defvar dol-library-name-face 'dol-library-name-face)
127 (setq dol-library-name-face 'font-lock-type-face)
129 (defvar dol-builtin-face 'dol-builtin-face)
130 (setq dol-builtin-face 'font-lock-builtin-face)
132 (defvar dol-comment-face 'dol-comment-face)
133 (setq dol-comment-face 'font-lock-comment-face)
135 (defvar dol-other-name-face 'dol-other-name-face)
137 (setq dol-other-name-face 'dol-blue-komma-face)
138 (setq dol-other-name-face 'font-lock-function-name-face)
141 (defvar dol-string-char-face 'dol-string-char-face)
142 (setq dol-string-char-face 'font-lock-string-face)
155 (defconst dol-font-lock-specialcomment
157 '("%%.*$" (0 (symbol-value 'dol-comment-face) keep t)))
161 (defconst dol-font-lock-annotations
162 (append dol-font-lock-specialcomment
166 (1 (symbol-value 'dol-annotation-face) keep t))
169 (0 (symbol-value 'dol-annotation-face) keep t))
172 (1 (symbol-value 'dol-annotation-face) keep t))
175 (1 (symbol-value 'dol-annotation-face) keep t))
179 (defconst dol-font-lock-keywords
180 (append dol-font-lock-annotations
184 (2 (symbol-value 'dol-keyword-face) keep t))
185 '("[,;.]" (0 (symbol-value 'dol-black-komma-face) t t))
188 (1 (symbol-value 'dol-black-komma-face) keep t))
191 (2 (symbol-value 'dol-builtin-face) keep t))
194 (2 (symbol-value 'dol-library-name-face) keep t)
195 (5 (symbol-value 'dol-library-name-face) keep t))
198 (2 (symbol-value 'dol-name-face) t t))
200 (1 (symbol-value 'dol-library-name-face) keep t))
203 (3 (symbol-value 'dol-name-face) keep t)
204 (5 (symbol-value 'dol-name-face) keep t))
207 (2 (symbol-value 'dol-name-face) keep t)
208 (4 (symbol-value 'dol-name-face) keep t))
211 (1 (symbol-value 'dol-name-face) keep t)
212 (3 (symbol-value 'dol-name-face) keep t)
213 (5 (symbol-value 'dol-name-face) keep t))
216 (2 (symbol-value 'dol-name-face) keep t)
217 (4 (symbol-value 'dol-name-face) keep t))
220 (2 (symbol-value 'dol-other-name-face) keep t))
223 (2 (symbol-value 'dol-other-name-face) keep t)
224 (3 (symbol-value 'dol-other-name-face) keep t))
227 (0 (symbol-value 'dol-other-name-face) keep t))
230 (1 (symbol-value 'dol-other-name-face) keep t)
231 (3 (symbol-value 'dol-other-name-face) keep t)
232 (4 (symbol-value 'dol-other-name-face) keep t)
233 (6 (symbol-value 'dol-other-name-face) keep t))
236 (2 (symbol-value 'dol-other-name-face) keep t)
237 (4 (symbol-value 'dol-other-name-face) keep t)
238 (6 (symbol-value 'dol-other-name-face) keep t))
241 (1 (symbol-value 'dol-other-name-face) keep t))
244 (1 (symbol-value 'dol-other-name-face) keep t))
247 (1 (symbol-value 'dol-other-name-face) keep t))
252 (defconst dol-font-lock-string
253 (append dol-font-lock-keywords
255 (0 (symbol-value 'dol-string-char-face) keep t))
260 ;; (defvar dol-font-lock-syntax-highligthing dol-font-lock-keywords
261 (defvar dol-font-lock-syntax-highligthing (symbol-value 'dol-font-lock-string)
267 (setq dol-error-list nil)
270 (defvar dol-hets-options nil
273 (defun dol-run-hets (&rest opt)
279 (dol-hets-file-name (buffer-file-name))
282 (setq dol-hets-program hets-program)
283 (setq dol-hets-program "hets"))
287 (setq hets-command (concat dol-hets-program run-option "\"" dol-hets-file-name "\""))
322 (set-process-sentinel proc 'dol-compilation-sentinel)
323 (set-process-filter proc 'dol-compilation-filter)
329 (defun dol-run-hets-r (&rest opt)
330 "Run hets process with options (from dol-hets-options) to compile the
336 (if dol-hets-options
337 (setq run-option-r dol-hets-options))
343 (dol-run-hets run-option-r)
346 (defun dol-run-hets-g ()
347 "Run hets process with -g and other options (from variable dol-hets-options)
350 (dol-run-hets-r "-g")
355 (defun dol-compilation-sentinel (proc msg)
371 (dol-compilation-handle-exit (process-status proc)
383 (defun dol-compilation-filter (proc string)
401 (defun dol-compilation-handle-exit (process-status exit-status msg)
422 ;; Automatically parse (and mouse-highlight) error messages:
424 (setq dol-error-list nil)
425 (setq dol-error-list nil)
426 (dol-parse-error)
427 (message "%s errors have been found." (length dol-error-list)))
432 (defun dol-parse-error ()
435 (setq dol-error-list nil)
445 (re-search-backward "\\(\(\\|\\s-+\\)\\([^.]+\\.\\(dol\\|het\\)\\)" nil t 1)
449 (setq error-line (match-string-no-properties 1))
450 (setq error-colnum (match-string-no-properties 2))
451 (setq error-window-point (point))
452 (setq dol-error-list
453 (nconc dol-error-list (list (list file-name error-line error-colnum error-window-point))))
457 (defun dol-compile-goto-next-error ()
458 "search the next error position from error-list, and move to it."
460 ;; if error-list is empty ...
461 (if (null dol-error-list)
462 (dol-parse-error))
463 (if (null dol-error-list)
465 (message "no error.")
467 (let* ((this-error (pop dol-error-list))
468 (error-file-name (nth 0 this-error))
469 (error-line (nth 1 this-error))
470 (error-column (nth 2 this-error))
471 (error-window-point (nth 3 this-error)))
473 ;; (message "DEBUG<Goto Error>: file: %s, line: %s, column: %s" error-file-name error-line error-column)
475 (if (get-file-buffer error-file-name)
476 (pop-to-buffer (get-file-buffer error-file-name))
477 (generate-new-buffer error-file-name)
478 (pop-to-buffer error-file-name)
479 (insert-file-contents error-file-name))
480 ;; switch to hets-run window to jump to next error message
483 (goto-char error-window-point)
486 (goto-line (string-to-number error-line))
487 (move-to-column (- (string-to-number error-column) 1))
488 (message "goto next error... line: %s column: %s" error-line error-column)
489 (setq dol-error-list (nconc dol-error-list (list this-error)))
493 ;; dol major mode setup
495 (defun dol-mode ()
498 (dol-vars)
499 (setq major-mode 'dol-mode)
502 (use-local-map dol-mode-map)
504 (set-syntax-table dol-mode-syntax-table)
505 ;; (dol-create-syntax-table)
509 '(dol-font-lock-syntax-highligthing))
513 ;; We just substitute our own functions to go to the error.
519 'dol-compile-mouse-goto-error)
521 'dol-compile-goto-next-error)))
522 (run-hooks 'dol-mode-hook)
525 (provide 'dol-mode)