Function: php-ts-mode--open-statement-group-heuristic

php-ts-mode--open-statement-group-heuristic is a byte-compiled function defined in php-ts-mode.el.gz.

Signature

(php-ts-mode--open-statement-group-heuristic NODE PARENT BOL &rest _)

Documentation

Heuristic matcher for statement-group without closing bracket.

Return php-ts-mode-indent-offset plus 1 when BOL is after php-ts-mode--possibly-braceless-keyword-re, otherwise return 0. It's useful for matching incomplete compound_statement or colon_block. PARENT is NODE's parent, BOL is the beginning of non-whitespace characters of the current line.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/php-ts-mode.el.gz
(defun php-ts-mode--open-statement-group-heuristic (node _parent bol &rest _)
  "Heuristic matcher for statement-group without closing bracket.

Return `php-ts-mode-indent-offset' plus 1 when BOL is after
`php-ts-mode--possibly-braceless-keyword-re', otherwise return 0.  It's
useful for matching incomplete compound_statement or colon_block.
PARENT is NODE's parent, BOL is the beginning of non-whitespace
characters of the current line."
  (and (null node)
       (save-excursion
	   (forward-line -1)
	   (if (re-search-forward
		php-ts-mode--possibly-braceless-keyword-re
		bol t)
	       (+ 1 php-ts-mode-indent-offset)
	     0))))