Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow non-ASCII names.

Ignore-this: f46f407a19ae2a597f44317e4915e5ba
The code already used char-classes unconditionally, though I didn't
think they're supported in XEmacs.

darcs-hash:20091105212057-d4134-79b583d7b7c153e3a44ab2a676c18f94c0fa06c2.gz
  • Loading branch information...
commit 1d2f9322cc213e058395f783bb8c7df4d740226f 1 parent 748ee94
@loveshack loveshack authored
View
15 haskell-font-lock.el
@@ -269,21 +269,10 @@ Returns keywords suitable for `font-lock-keywords'."
;; (ASCsymbol "-!#$%&*+./<=>?@\\\\^|~")
;; Put the minus first to make it work in ranges.
- ;; (ISOsymbol "\241-\277\327\367")
- (ISOlarge "\300-\326\330-\337")
- (ISOsmall "\340-\366\370-\377")
- (small
- (if haskell-emacs21-features "[:lower:]" (concat "a-z" ISOsmall)))
- (large
- (if haskell-emacs21-features "[:upper:]" (concat "A-Z" ISOlarge)))
- (alnum
- (if haskell-emacs21-features "[:alnum:]" (concat small large "0-9")))
- ;; (symbol
- ;; (concat ASCsymbol ISOsymbol))
;; We allow _ as the first char to fit GHC
- (varid (concat "\\b[" small "_][" alnum "'_]*\\b"))
- (conid (concat "\\b[" large "][" alnum "'_]*\\b"))
+ (varid "\\b[[:lower:]_][[:alnum:]'_]*\\b")
+ (conid "\\b[[:upper:]][[:alnum:]'_]*\\b")
(modid (concat "\\b" conid "\\(\\." conid "\\)*\\b"))
(qvarid (concat modid "\\." varid))
(qconid (concat modid "\\." conid))
View
3  haskell-ghci.el
@@ -176,7 +176,8 @@ Prompt for a list of args if called with an argument."
(add-hook 'comint-input-filter-functions 'shell-directory-tracker nil 'local)
;; GHCi prompt should be of the form `ModuleName> '.
- (setq comint-prompt-regexp "^\\*?[A-Z][\\._a-zA-Z0-9]*\\( \\*?[A-Z][\\._a-zA-Z0-9]*\\)*> ")
+ (setq comint-prompt-regexp
+ "^\\*?[[:upper:]][\\._[:alnum:]]*\\( \\*?[[:upper:]][\\._[:alnum:]]*\\)*> ")
;; History syntax of comint conflicts with Haskell, e.g. !!, so better
;; turn it off.
View
2  haskell-hugs.el
@@ -179,7 +179,7 @@ Prompts for a list of args if called with an argument."
(setq shell-dirtrackp t)
(add-hook 'comint-input-filter-functions 'shell-directory-tracker nil 'local)
; ? or module name in Hugs 1.4
- (setq comint-prompt-regexp "^\? \\|^[A-Z][_a-zA-Z0-9\.]*> ")
+ (setq comint-prompt-regexp "^\? \\|^[[:upper:]][_[:alnum:]\.]*> ")
;; comint's history syntax conflicts with Hugs syntax, eg. !!
(setq comint-input-autoexpand nil)
(run-hooks 'haskell-hugs-hook)
View
3  haskell-indent.el
@@ -392,7 +392,8 @@ Returns the location of the start of the comment, nil otherwise."
(cond
((haskell-indent-empty-line-p) 'empty)
((haskell-indent-in-comment (point-min) (point)) 'comment)
- ((looking-at "\\(\\([a-zA-Z]\\(\\sw\\|'\\)*\\)\\|_\\)[ \t\n]*") 'ident)
+ ((looking-at "\\(\\([[:alpha:]]\\(\\sw\\|'\\)*\\)\\|_\\)[ \t\n]*")
+ 'ident)
((looking-at "\\(|[^|]\\)[ \t\n]*") 'guard)
((looking-at "\\(=[^>=]\\|::\\|->\\|<-\\)[ \t\n]*") 'rhs)
(t 'other)))
View
10 haskell-indentation.el
@@ -834,7 +834,7 @@ Preserves indentation and removes extra whitespace"
(t (setq current-token (haskell-indentation-peek-token))))))))
(defun haskell-indentation-peek-token ()
- (cond ((looking-at "\\(if\\|then\\|else\\|let\\|in\\|mdo\\|do\\|case\\|of\\|where\\|module\\|deriving\\|data\\|type\\|newtype\\|class\\|instance\\)\\([^A-Za-z']\\|$\\)")
+ (cond ((looking-at "\\(if\\|then\\|else\\|let\\|in\\|do\\|case\\|of\\|where\\|module\\|deriving\\|data\\|type\\|newtype\\|class\\|instance\\)\\([^A-Za-z']\\|$\\)")
(match-string 1))
((looking-at "[][(){}[,;]")
(match-string 0))
@@ -848,12 +848,14 @@ Preserves indentation and removes extra whitespace"
"Skip to the next token."
(if (or (looking-at "'\\([^\\']\\|\\\\.\\)*'")
(looking-at "\"\\([^\\\"]\\|\\\\.\\)*\"")
- (looking-at "[A-Z][A-Z_a-z0-9']*\\(\\.[A-Z_a-z][A-Z_a-z0-9']*\\)*") ; Allows hierarchical modules
- (looking-at "[A-Z_a-z][A-Z_a-z0-9']*") ; Only unqualified vars can start with lowercase
+ (looking-at ; Allows hierarchical modules
+ "[[:upper:]][[:alnum:]_']]*\\(\\.[[:alpha:]_][[:alnum:]_']*\\)*")
+ (looking-at ; Only unqualified vars can start with lowercase
+ "[[:alnum:]_'][[:alnum:]_']*")
(looking-at "[0-9][0-9oOxXeE+-]*")
(looking-at "[-:!#$%&*+./<=>?@\\\\^|~]+")
(looking-at "[](){}[,;]")
- (looking-at "`[A-Za-z0-9']*`"))
+ (looking-at "`[[:alnum:]']*`"))
(goto-char (match-end 0))
;; otherwise skip until space found
(skip-syntax-forward "^-"))
View
3  inf-haskell.el
@@ -126,7 +126,8 @@ This will either look for a Cabal file or a \"module\" statement in the file."
(define-derived-mode inferior-haskell-mode comint-mode "Inf-Haskell"
"Major mode for interacting with an inferior Haskell process."
(set (make-local-variable 'comint-prompt-regexp)
- "^\\*?[A-Z][\\._a-zA-Z0-9]*\\( \\*?[A-Z][\\._a-zA-Z0-9]*\\)*> ")
+ ;; Whay the backslash in [\\._[:alnum:]]?
+ "^\\*?[[:upper:]][\\._[:alnum:]]*\\(?: \\*?[[:upper:]][\\._[:alnum:]]*\\)*> ")
(set (make-local-variable 'comint-input-autoexpand) nil)
(add-hook 'comint-output-filter-functions 'inferior-haskell-spot-prompt nil t)
Please sign in to comment.
Something went wrong with that request. Please try again.