1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

remove cggl, cg-generic-lambda

* module/ice-9/peg.scm (cg-generic-lambda, cggl): Remove these helpers,
  they are no longer needed.
  (cg-generic-ret): Remove optimization for particular cg- routines, as
  it's no longer needed.
This commit is contained in:
Andy Wingo 2011-02-18 11:13:39 +01:00
parent e9722ec0aa
commit 63a1336de7

View file

@ -89,22 +89,6 @@ return EXP."
;; accum: (all name body none)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Code we generate will be defined in a function, and always has to test
;; whether it's beyond the bounds of the string before it executes.
(define (cg-generic-lambda for-syntax str strlen at code)
;; all arguments are syntax
#`(lambda (#,str #,strlen #,at)
(if (>= #,at #,strlen)
#f
#,code)))
;; The short name makes the formatting below much easier to read.
(define cggl cg-generic-lambda)
;; Optimizations for CG-GENERIC-RET below...
(define *op-known-single-body* '(cg-string cg-peg-any cg-range))
;; ...done with optimizations (could use more of these).
;; Code we generate will have a certain return structure depending on how we're
;; accumulating (the ACCUM variable).
(define (cg-generic-ret for-syntax accum name body-uneval at)
@ -121,13 +105,10 @@ return EXP."
((eq? accum 'name)
#`(list #,at '#,name))
((eq? accum 'body)
(cond
((member (syntax->datum name) *op-known-single-body*)
#`(list #,at body))
(else #`(list #,at
#`(list #,at
(cond
((single? body) (car body))
(else body))))))
(else body))))
((eq? accum 'none)
#`(list #,at '()))
(else