[MLton-commit] r4987
Vesa Karvonen
vesak at mlton.org
Tue Dec 19 08:14:45 PST 2006
Added minimal support for compiler specific annotations.
----------------------------------------------------------------------
U mlton/trunk/ide/emacs/esml-mlb-mode.el
----------------------------------------------------------------------
Modified: mlton/trunk/ide/emacs/esml-mlb-mode.el
===================================================================
--- mlton/trunk/ide/emacs/esml-mlb-mode.el 2006-12-19 02:59:11 UTC (rev 4986)
+++ mlton/trunk/ide/emacs/esml-mlb-mode.el 2006-12-19 16:14:45 UTC (rev 4987)
@@ -242,21 +242,23 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Syntax and highlighting
-(defconst esml-mlb-string-continue-regexp "\\(\\\\[ \t\n]+\\\\\\)")
+(defconst esml-mlb-string-continue-regexp "\\(?:\\\\[ \t\n]+\\\\\\)")
(defconst esml-mlb-string-char-regexp
- (concat "\\(" esml-mlb-string-continue-regexp
- "*\\([^\n\"\\]\\|\\\\[^ \t\n]\\)\\)"))
+ (concat "\\(?:" esml-mlb-string-continue-regexp
+ "*\\(?:[^\n\"\\]\\|\\\\[^ \t\n]\\)\\)"))
(defconst esml-mlb-inside-string-regexp
(concat "\"" esml-mlb-string-char-regexp "*"
esml-mlb-string-continue-regexp "*"))
(defconst esml-mlb-string-regexp (concat esml-mlb-inside-string-regexp "\""))
-(defconst esml-mlb-inside-comment-regexp "(\\*\\([^*]\\|\\*[^)]\\)*")
+(defconst esml-mlb-inside-comment-regexp "(\\*\\(?:[^*]\\|\\*[^)]\\)*")
(defconst esml-mlb-comment-regexp
(concat esml-mlb-inside-comment-regexp "\\*)"))
(defconst esml-mlb-path-var-chars "A-Za-z0-9_")
(defconst esml-mlb-unquoted-path-chars "-A-Za-z0-9_/.")
(defconst esml-mlb-unquoted-path-or-ref-chars
(concat esml-mlb-unquoted-path-chars "()$"))
+(defconst esml-mlb-compiler-ann-prefix
+ (concat "\\(?:" esml-mlb-string-char-regexp "*:[ \t]*\\)"))
(defun esml-mlb-<token>-to-regexp (<token>)
(let* ((<token>-to-regexp
@@ -309,7 +311,7 @@
;; annotations
(,(apply
'concat
- "\"[ \t]*\\("
+ "\"[ \t]*" esml-mlb-compiler-ann-prefix "?\\("
(reduce
(function
(lambda (regexps name-values)
@@ -484,7 +486,7 @@
;; annotation values
((esml-point-preceded-by
- (concat "\"[ \t\n]*\\("
+ (concat "\"[ \t\n]*" esml-mlb-compiler-ann-prefix "?\\("
(regexp-opt (mapcar 'car esml-mlb-annotations))
"\\)[ \t\n]+\\(" esml-mlb-string-char-regexp "*\\)"))
(let* ((annot (assoc (match-string 1) esml-mlb-annotations))
@@ -511,7 +513,8 @@
(concat "\\<ann[ \t\n]+\\([ \t\n]+\\|" esml-mlb-string-regexp
"\\|" esml-mlb-comment-regexp "\\)*\"[^\"]*"))
(esml-point-preceded-by
- (concat "\"[ \t\n]*\\(" esml-mlb-string-char-regexp "*\\)")))
+ (concat "\"[ \t\n]*" esml-mlb-compiler-ann-prefix "?\\("
+ esml-mlb-string-char-regexp "*\\)")))
(let* ((name-prefix (match-string 1))
(name-completion (try-completion name-prefix esml-mlb-annotations))
(name (if (eq t name-completion) name-prefix name-completion)))
More information about the MLton-commit
mailing list