- (let (nl-prop
- (pos-or-point (progn (if pos (goto-char pos)) (point))))
- (forward-line 0)
- (search-forward-regexp c-awk-one-line-non-syn-ws*-re)
+ (let* (nl-prop
+ (pos-or-point (progn (if pos (goto-char pos)) (point)))
+ (bol (c-point 'bol)) (eol (c-point 'eol)))
+ (c-awk-beginning-of-logical-line)
+ ;; Next `while' goes round one logical line (ending in, e.g. "\\") per
+ ;; iteration. Such a line is rare, and can only be an open string
+ ;; ending in an escaped \.
+ (while
+ (progn
+ ;; Next `while' goes over a division sign or /regexp/ per iteration.
+ (while
+ (and
+ (< (point) eol)
+ (progn
+ (search-forward-regexp c-awk-non-/-syn-ws*-re eol)
+ (looking-at c-awk-space*-/-re)))
+ (cond
+ ((looking-at c-awk-space*-regexp-/-re) ; /regexp/
+ (forward-sexp))
+ ((looking-at c-awk-space*-unclosed-regexp-/-re) ; Unclosed /regexp
+ (condition-case nil
+ (progn
+ (forward-sexp)
+ (backward-char)) ; Move to end of (logical) line.
+ (error (end-of-line)))) ; Happens at EOB.
+ (t ; division sign
+ (c-forward-syntactic-ws)
+ (forward-char))))
+ (< (point) bol))
+ (forward-line))