Function: gud-expr-compound

gud-expr-compound is a byte-compiled function defined in gud.el.gz.

Signature

(gud-expr-compound FIRST SECOND)

Documentation

Non-nil if concatenating FIRST and SECOND makes a single C expression.

The two exprs are represented as a cons cells, where the car specifies the point in the current buffer that marks the beginning of the expr and the cdr specifies the character after the end of the expr. Link exprs of the form:
      Expr -> Expr
      Expr . Expr
      Expr (Expr)
      Expr [Expr]
      (Expr) Expr
      [Expr] Expr

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
(defun gud-expr-compound (first second)
  "Non-nil if concatenating FIRST and SECOND makes a single C expression.
The two exprs are represented as a cons cells, where the car
specifies the point in the current buffer that marks the beginning of the
expr and the cdr specifies the character after the end of the expr.
Link exprs of the form:
      Expr -> Expr
      Expr . Expr
      Expr (Expr)
      Expr [Expr]
      (Expr) Expr
      [Expr] Expr"
  (let ((span-start (cdr first))
	(span-end (car second))
	(syntax))
    (setq syntax (gud-expr-compound-sep span-start span-end))
    (cond
     ((= (car first) (car second)) nil)
     ((= (cdr first) (cdr second)) nil)
     ((= syntax ?.) t)
     ((= syntax ?\s)
      (setq span-start (char-after (- span-start 1)))
      (setq span-end (char-after span-end))
      (cond
       ((= span-start ?\)) t)
      ((= span-start ?\]) t)
     ((= span-end ?\() t)
      ((= span-end ?\[) t)
       (t nil)))
     (t nil))))