Changeset 9885 in project


Ignore:
Timestamp:
03/18/08 18:13:32 (12 years ago)
Author:
Alex Shinn
Message:

Fixing bug in line-number database handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/riaxpander/chicken.scm

    r9705 r9885  
    309309                  history)))))))
    310310
     311(define (chicken/record-source?)
     312  (and ##sys#line-number-database #t))
     313
    311314(define (chicken/clobber-source-record input-form output-form)
    312   (if (and ##sys#line-number-database input-form)
    313       (let ((input-operator (car input-form))
    314             (output-operator (car output-form)))
    315         (define (original-bucket)
    316           (##sys#hash-table-ref ##sys#line-number-database input-operator))
    317         (cond ((eq? input-operator output-operator)
    318                (cond ((assq input-form (or (original-bucket) '()))
    319                       => (lambda (cell)
    320                            (set-cdr! cell output-form)))))
    321               ((get-line-number input-form)
    322                => (lambda (line)
    323                     (##sys#hash-table-set!
    324                      ##sys#line-number-database
    325                      output-operator
    326                      (cons (cons output-form line) (original-bucket)))))))))
     315  (let ((input-operator (car input-form))
     316        (output-operator (car output-form)))
     317    (define (original-bucket)
     318      (##sys#hash-table-ref ##sys#line-number-database input-operator))
     319    (cond ((eq? input-operator output-operator)
     320           (cond ((assq input-form (or (original-bucket) '()))
     321                  => (lambda (cell)
     322                       (set-cdr! cell output-form)))))
     323          ((get-line-number input-form)
     324           => (lambda (line)
     325                (##sys#hash-table-set!
     326                 ##sys#line-number-database
     327                 output-operator
     328                 (cons (cons output-form line) (original-bucket))))))))
    327329
    328330
     
    549551
    550552(define (chicken/compile-combination operator operands history)
    551   (let ((input-form
    552          (and history (reduction/form (history/original-reduction history))))
    553         (output-form `(,operator ,@operands)))
    554     (chicken/clobber-source-record input-form output-form)
     553  (let ((output-form `(,operator ,@operands)))
     554    (cond ((and (symbol? operator)
     555                history
     556                (chicken/record-source?)
     557                (find (lambda (reduction)
     558                        (let ((form (reduction/form reduction)))
     559                          (and (pair? form)
     560                               (symbol? (car form)))))
     561                      (reverse (history/reductions history))))
     562           => (lambda (reduction)
     563                (chicken/clobber-source-record (reduction/form reduction)
     564                                               output-form))))
    555565    output-form))
    556566
Note: See TracChangeset for help on using the changeset viewer.