Function: hif-nexttoken

hif-nexttoken is a byte-compiled function defined in hideif.el.gz.

Signature

(hif-nexttoken &optional KEEP-SPACE)

Documentation

Pop the next token from token-list into the let variable hif-token.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/hideif.el.gz
;;------------------------------------------------------------------------
;; Translate C preprocessor #if expressions using recursive descent.
;; This parser was limited to the operators &&, ||, !, and "defined".
;; Added ==, !=, +, and -.  Gary Oberbrunner, garyo@avs.com, 8/9/94
;;
;; Implement the C language operator precedence table. Add all those
;; missing operators that could be used in macros. Luke Lee 2013-09-04

;;  | Operator Type        | Operator                    | Associativity |
;;  +----------------------+-----------------------------+---------------+
;;  | Primary Expression   | () [] . -> expr++ expr--    | left-to-right |
;;  | Unary Operators      | * & + - ! ~ ++expr --expr   | right-to-left |
;;  |                      | (typecast) sizeof           |               |
;;  | Binary Operators     | * / %                       | left-to-right |
;;  |                      | + -                         |               |
;;  |                      | >> <<                       |               |
;;  |                      | < > <= >=                   |               |
;;  |                      | == !=                       |               |
;;  |                      | &                           |               |
;;  |                      | ^                           |               |
;;  |                      | |                           |               |
;;  |                      | &&                          |               |
;;  |                      | ||                          |               |
;;  | Ternary Operator     | ?:                          | right-to-left |
;; x| Assignment Operators | = += -= *= /= %= >>= <<= &= | right-to-left |
;;  |                      | ^= =                        |               |
;;  | Comma                | ,                           | left-to-right |

(defun hif-nexttoken (&optional keep-space)
  "Pop the next token from token-list into the let variable `hif-token'."
  (let ((prevtoken hif-token))
    (while (progn
             (setq hif-token (pop hif-token-list))
             (if keep-space ; keep only one space
                 (and (eq prevtoken 'hif-space)
                      (eq hif-token 'hif-space))
               (eq hif-token 'hif-space)))))
  hif-token)