Changeset 27329 in project


Ignore:
Timestamp:
08/29/12 15:31:59 (9 years ago)
Author:
Alan Post
Message:

genturfa'i: handle boolean in {}-expr parser.

This routine may be called many times while initializing a .peg
file. Since we clear the global variable for memo-names each
time through, we must handle boolean as a non-error case.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/genturfahi/trunk/samselpla.scm

    r27328 r27329  
    141141          jalge)))))
    142142
     143;; This routine is called once for every {}-expr in a .peg file.
     144;; Update our global state (and in the case of memoization, clear
     145;; the global variable.) each time through.
     146;;
     147;; This routine must return #f if there is a problem with the sexpr
     148;; in the {}-expr.
     149;;
    143150(define (samselpla-cfari-samselpla #!key rodalerfu)
    144151  (let* ((valsi     (apply string rodalerfu))
     
    157164      (type-case no-memoize
    158165        (string (hash-table-set! samselpla-namorji no-memoize #t)
    159                 ; success
    160                 #t)
    161         (list   (for-each (lambda (naselci)
    162                             (hash-table-set! samselpla-namorji naselci #t))
    163                           no-memoize)
    164                 ; success
    165                 #t)
     166                 ; success
     167                 #t)
     168        (list    (for-each (lambda (naselci)
     169                             (hash-table-set! samselpla-namorji naselci #t))
     170                           no-memoize)
     171                 ; success
     172                 #t)
     173                 ; success, default case
     174        (boolean #t)
    166175        ;;
    167176        ;; this should be an error case, but I haven't built an
    168177        ;; error handling framework for this system yet.
    169178        ;;
    170         (else   #f)))))
     179        (else    #f)))))
    171180
    172181;; emit the non-terminal with it's rule.
Note: See TracChangeset for help on using the changeset viewer.