(if (and (eq (char-syntax (preceding-char)) ?w)
(eq (char-syntax (following-char)) ?w))
(save-excursion
- (backward-word 1)
+ (backward-word-strictly 1)
(if (looking-at "end\\>\\|else\\>\\|otherwise\\>\\|when\\>")
(setq return-value nil)))))
((memq (preceding-char) '(?! ?t ?T))
(1+ count)))))
(while (< count 0)
(re-search-forward "\\<begin\\>\\|\\<end\\>")
- (backward-word 1)
+ (backward-word-strictly 1)
(if (not (simula-context))
(setq count (if (memq (following-char) '(?e ?E))
(1+ count)
(1- count))))
- (backward-word -1)))
+ (backward-word-strictly -1)))
;; If block level not found, jump back to origin and signal an error
(error (progn
(goto-char origin)
(if (< count start-count) (signal 'error nil)))
(while (> count 0)
(re-search-forward "\\<begin\\>\\|\\<end\\>")
- (backward-word 1)
+ (backward-word-strictly 1)
(if (not (simula-context))
(setq count (if (memq (following-char) '(?b ?B))
(1- count)
(1+ count))))
- (backward-word -1)
+ (backward-word-strictly -1)
;; deeper level has to be found within starting block
(if (> count start-count) (signal 'error nil))))
;; If block level not found, jump back to origin and signal an error
(simula-skip-comment-backward)
(if (memq (preceding-char) '(?n ?N))
(progn
- (backward-word 1)
+ (backward-word-strictly 1)
(if (not (looking-at "\\<begin\\>"))
- (backward-word -1)))
+ (backward-word-strictly -1)))
(if (eq (preceding-char) ?\;)
(backward-char 1))
)
(progn
(if (eq (following-char) ?\;)
(forward-char 1)
- (backward-word -1))))
+ (backward-word-strictly -1))))
(simula-skip-comment-forward))
(error (progn (goto-char origin)
(error "Incomplete statement (too many ENDs)")))
(condition-case ()
(progn
(simula-skip-comment-forward)
- (if (looking-at "\\<end\\>") (forward-word 1))
+ (if (looking-at "\\<end\\>") (forward-word-strictly 1))
(while (and (natnump (setq count (1- count)))
(setq status (simula-search-forward
";\\|\\<end\\>" (point-max) 'move))))
(if (and status (/= (preceding-char) ?\;))
(progn
- (backward-word 1)
+ (backward-word-strictly 1)
(simula-skip-comment-backward))))
(error (progn (goto-char origin)
(error "Incomplete statement (too few ENDs)")))
((eq context 2)
;; an END-comment must belong to an END
(re-search-backward "\\<end\\>")
- (forward-word 1)
+ (forward-word-strictly 1)
(throw 'simula-out nil))
;; should be impossible to get here..
)))))
((memq (following-char) '(?E ?e))
(setq indent (cdr simula-if-indent)))
(t
- (forward-word 1)
+ (forward-word-strictly 1)
(setq indent 0)))
(simula-find-if))
;;
(not (eq (preceding-char) ?\;))
(if (memq (preceding-char) '(?N ?n))
(save-excursion
- (backward-word 1)
+ (backward-word-strictly 1)
(not (looking-at "begin\\>")))
t))
(progn
;; (not found-end)
(if (eq (char-syntax (preceding-char)) ?w)
(progn
- (backward-word 1)
+ (backward-word-strictly 1)
(not (looking-at
"begin\\|then\\|else\\|when\\|otherwise\\|do"
)))
((looking-at "begin\\>")
(setq indent (+ indent simula-indent-level)))
((looking-at "end\\>")
- (forward-word 1)
+ (forward-word-strictly 1)
(simula-previous-statement 1))
((looking-at "do\\>")
(setq indent (+ indent simula-substatement-offset))
(simula-find-do-match))
((looking-at "\\(if\\|then\\|else\\)\\>")
(if (memq temp '(?I ?i))
- (forward-word 1)
+ (forward-word-strictly 1)
(setq indent (+ indent
simula-substatement-offset
(if (memq temp '(?T ?t))
(and (not (bobp))
(if (eq (char-syntax (preceding-char)) ?w)
(save-excursion
- (backward-word 1)
+ (backward-word-strictly 1)
(not (looking-at
"begin\\|then\\|else\\|when\\|otherwise\\|do")))
(not (memq (preceding-char) '(?: ?\;))))))
(simula-skip-comment-backward)
(if (and (eq (char-syntax (preceding-char)) ?w)
(progn
- (backward-word 1)
+ (backward-word-strictly 1)
(looking-at "else\\>")))
()
(throw 'simula-out t)))
(if where
(if (and (eq where 2) (eq (char-syntax (preceding-char)) ?w))
(save-excursion
- (backward-word 1)
+ (backward-word-strictly 1)
(not (looking-at "end\\>"))))))
(unexpand-abbrev)
(cond
;; check if the expanded word is on the beginning of the line.
(if (and (eq (char-syntax (preceding-char)) ?w)
(progn
- (backward-word 1)
+ (backward-word-strictly 1)
(if (looking-at "end\\>")
(save-excursion
(simula-backward-up-level 1)