comparison lisp/progmodes/hideif.el @ 41753:bf8b35f0db41

(hif-nexttoken): Move to before first def.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 01 Dec 2001 18:20:52 +0000
parents c2b7b74ef973
children 91939e9a62ec
comparison
equal deleted inserted replaced
41752:0a900c386e8f 41753:bf8b35f0db41
352 ;;;----------------------------------------------------------------- 352 ;;;-----------------------------------------------------------------
353 ;;; Translate C preprocessor #if expressions using recursive descent. 353 ;;; Translate C preprocessor #if expressions using recursive descent.
354 ;;; This parser is limited to the operators &&, ||, !, and "defined". 354 ;;; This parser is limited to the operators &&, ||, !, and "defined".
355 ;;; Added ==, !=, +, and -. Gary Oberbrunner, garyo@avs.com, 8/9/94 355 ;;; Added ==, !=, +, and -. Gary Oberbrunner, garyo@avs.com, 8/9/94
356 356
357 (defsubst hif-nexttoken ()
358 "Pop the next token from token-list into the let variable \"hif-token\"."
359 (setq hif-token (pop hif-token-list)))
360
357 (defun hif-parse-if-exp (hif-token-list) 361 (defun hif-parse-if-exp (hif-token-list)
358 "Parse the TOKEN-LIST. Return translated list in prefix form." 362 "Parse the TOKEN-LIST. Return translated list in prefix form."
359 (hif-nexttoken) 363 (hif-nexttoken)
360 (prog1 364 (prog1
361 (hif-expr) 365 (hif-expr)
362 (if hif-token ; is there still a token? 366 (if hif-token ; is there still a token?
363 (error "Error: unexpected token: %s" hif-token)))) 367 (error "Error: unexpected token: %s" hif-token))))
364
365 (defsubst hif-nexttoken ()
366 "Pop the next token from token-list into the let variable \"hif-token\"."
367 (setq hif-token (pop hif-token-list)))
368 368
369 (defun hif-expr () 369 (defun hif-expr ()
370 "Parse an expression as found in #if. 370 "Parse an expression as found in #if.
371 expr : term | expr '||' term." 371 expr : term | expr '||' term."
372 (let ((result (hif-term))) 372 (let ((result (hif-term)))