256 |
(let ((point (point))) |
(let ((point (point))) |
257 |
(ignore-errors (forward-sexp 1)) |
(ignore-errors (forward-sexp 1)) |
258 |
(if (/= point (point)) t (forward-char 1) nil))) |
(if (/= point (point)) t (forward-char 1) nil))) |
259 |
;; let...end atoms |
;; stop as soon as precedence is smaller than `prec' |
260 |
((or (string-match sml-begin-symbols-re op) |
((and prec op-prec (>= prec op-prec)) nil) |
261 |
(and (not prec) |
;; special rules for nested constructs like if..then..else |
262 |
(or (string= "in" op) (string= "with" op)))) |
((and (or (not prec) (and prec op-prec)) |
263 |
(sml-find-match-forward sml-begin-symbols-re "\\<end\\>")) |
(setq match (cdr (assoc op sml-open-paren)))) |
264 |
|
(sml-find-match-forward (first match) (second match))) |
265 |
|
;; don't back over open-parens |
266 |
|
((assoc op sml-close-paren) nil) |
267 |
;; infix ops precedence |
;; infix ops precedence |
268 |
((and prec op-prec) (< prec op-prec)) |
((and prec op-prec) (< prec op-prec)) |
|
;; [ prec = nil ] if...then...else |
|
|
;; ((or (string= "else" op) (string= "then" op)) |
|
|
;; (sml-find-match-backward "\\<else\\>" "\\<if\\>")) |
|
|
;; [ prec = nil ] case...of |
|
|
;; ((string= "of" op) |
|
|
;; (sml-find-match-backward "\\<of\\>" "\\<case\\>")) |
|
|
;; [ prec = nil ] while...do |
|
|
;; ((string= "do" op) |
|
|
;; (sml-find-match-backward "\\<do\\>" "\\<while\\>")) |
|
269 |
;; [ prec = nil ] a new operator, let's skip the sexps until the next |
;; [ prec = nil ] a new operator, let's skip the sexps until the next |
270 |
(op-prec (while (sml-move-if (sml-forward-sexp op-prec))) t) |
(op-prec (while (sml-move-if (sml-forward-sexp op-prec))) t) |
271 |
;; special symbols indicating we're getting out of a nesting level |
;; special symbols indicating we're getting out of a nesting level |