Skip to content

Commit 7609a68

Browse files
committed
Case split improvements
1 parent 3e95336 commit 7609a68

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

elisp/shm-case-split.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@ Where the _ and undefineds are evaporating slots."
7171
"Given a data declaration STRING, generate a list of alternatives."
7272
(with-temp-buffer
7373
(insert (replace-regexp-in-string
74-
"[a-zA-Z0-9]+-[0-9.]+:"
74+
"[A-Z][a-zA-Z0-9_'.]+?\\."
7575
""
76-
string))
76+
(replace-regexp-in-string
77+
"[a-zA-Z0-9]+-[0-9.]+:"
78+
""
79+
string)))
7780
(text-mode)
7881
(structured-haskell-mode)
7982
(setq shm-last-parse-start (point-max))
@@ -162,8 +165,8 @@ White space here is any of: space, tab, emacs newline (line feed, ASCII 10)."
162165
() to allow shm/case-split to work in more cases."
163166
(let* ((clean-s (car
164167
(last
165-
(mapcar 'shm-trim-string
166-
(split-string s "=>"))))))
168+
(mapcar 'shm-trim-string
169+
(split-string s "=>"))))))
167170
(if s
168171
(let ((case-fold-search nil))
169172
(replace-regexp-in-string "\\b[a-z_][A-Za-z_]*\\b" "()" clean-s))

0 commit comments

Comments
 (0)