(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/parser/stream#char-stream::t
    (make-struct-type
     'std/parser/stream#char-stream::t
     '#f
     '4
     'char-stream
     '((final: . #t))
     ':init!
     '(port buf loc lines)))
  (define std/parser/stream#char-stream?
    (make-struct-predicate std/parser/stream#char-stream::t))
  (define std/parser/stream#make-char-stream
    (lambda _$args838_
      (apply make-struct-instance
             std/parser/stream#char-stream::t
             _$args838_)))
  (define std/parser/stream#char-stream-port
    (make-struct-field-accessor std/parser/stream#char-stream::t '0))
  (define std/parser/stream#char-stream-buf
    (make-struct-field-accessor std/parser/stream#char-stream::t '1))
  (define std/parser/stream#char-stream-loc
    (make-struct-field-accessor std/parser/stream#char-stream::t '2))
  (define std/parser/stream#char-stream-lines
    (make-struct-field-accessor std/parser/stream#char-stream::t '3))
  (define std/parser/stream#char-stream-port-set!
    (make-struct-field-mutator std/parser/stream#char-stream::t '0))
  (define std/parser/stream#char-stream-buf-set!
    (make-struct-field-mutator std/parser/stream#char-stream::t '1))
  (define std/parser/stream#char-stream-loc-set!
    (make-struct-field-mutator std/parser/stream#char-stream::t '2))
  (define std/parser/stream#char-stream-lines-set!
    (make-struct-field-mutator std/parser/stream#char-stream::t '3))
  (define std/parser/stream#char-stream:::init!
    (lambda (_self835_ _port836_)
      (if (macro-character-input-port? _port836_)
          '#!void
          (error '"Bad input source; not a character-input-port" _port836_))
      (if (let ((__tmp4495
                 (let () (declare (not safe)) (##vector-length _self835_))))
            (declare (not safe))
            (##fx< '4 __tmp4495))
          (begin
            (let ()
              (declare (not safe))
              (##vector-set! _self835_ '1 _port836_))
            (let () (declare (not safe)) (##vector-set! _self835_ '2 '()))
            (let ((__tmp4496
                   (let ()
                     (declare (not safe))
                     (##structure
                      std/parser/base#location::t
                      _port836_
                      '0
                      '0
                      '0
                      '0))))
              (declare (not safe))
              (##vector-set! _self835_ '3 __tmp4496))
            (let () (declare (not safe)) (##vector-set! _self835_ '4 '())))
          (error '"struct-instance-init!: too many arguments for struct"
                 _self835_))))
  (bind-method!
   std/parser/stream#char-stream::t
   ':init!
   std/parser/stream#char-stream:::init!
   '#f)
  (define std/parser/stream#char-stream-close
    (lambda (_cs709_)
      (close-input-port
       (##direct-structure-ref
        _cs709_
        '1
        std/parser/stream#char-stream::t
        '#f))))
  (define std/parser/stream#char-stream-getc
    (lambda (_cs626_)
      (let* ((_cs627636_ _cs626_)
             (_E629640_ (lambda () (error '"No clause matching" _cs627636_)))
             (_K630686_
              (lambda (_lines643_ _loc644_ _buf645_ _port646_)
                (let* ((_buf647655_ _buf645_)
                       (_else649668_
                        (lambda ()
                          (let* ((_loc663_
                                  (std/parser/stream#port-location _port646_))
                                 (_char665_ (read-char _port646_)))
                            (if (eof-object? _char665_)
                                '#!void
                                (begin
                                  (##direct-structure-set!
                                   _cs626_
                                   _loc663_
                                   '3
                                   std/parser/stream#char-stream::t
                                   '#f)
                                  (if (eq? '#\newline _char665_)
                                      (##direct-structure-set!
                                       _cs626_
                                       (cons (##direct-structure-ref
                                              _loc663_
                                              '5
                                              std/parser/base#location::t
                                              '#f)
                                             _lines643_)
                                       '4
                                       std/parser/stream#char-stream::t
                                       '#f)
                                      '#!void)))
                            _char665_)))
                       (_K651674_
                        (lambda (_rest671_ _char672_)
                          (##direct-structure-set!
                           _cs626_
                           _rest671_
                           '2
                           std/parser/stream#char-stream::t
                           '#f)
                          (##direct-structure-set!
                           _cs626_
                           (std/parser/stream#location-getc
                            _loc644_
                            _char672_
                            _lines643_)
                           '3
                           std/parser/stream#char-stream::t
                           '#f)
                          _char672_)))
                  (if (let () (declare (not safe)) (##pair? _buf647655_))
                      (let ((_hd652677_
                             (let () (declare (not safe)) (##car _buf647655_)))
                            (_tl653679_
                             (let ()
                               (declare (not safe))
                               (##cdr _buf647655_))))
                        (let* ((_char682_ _hd652677_) (_rest684_ _tl653679_))
                          (_K651674_ _rest684_ _char682_)))
                      (_else649668_))))))
        (if (let ()
              (declare (not safe))
              (##structure-direct-instance-of?
               _cs627636_
               'std/parser/stream#char-stream::t))
            (let* ((_e631689_
                    (let () (declare (not safe)) (##vector-ref _cs627636_ '1)))
                   (_port692_ _e631689_)
                   (_e632694_
                    (let () (declare (not safe)) (##vector-ref _cs627636_ '2)))
                   (_buf697_ _e632694_)
                   (_e633699_
                    (let () (declare (not safe)) (##vector-ref _cs627636_ '3)))
                   (_loc702_ _e633699_)
                   (_e634704_
                    (let () (declare (not safe)) (##vector-ref _cs627636_ '4)))
                   (_lines707_ _e634704_))
              (_K630686_ _lines707_ _loc702_ _buf697_ _port692_))
            (_E629640_)))))
  (define std/parser/stream#char-stream-ungetc
    (lambda (_cs580_ _char581_)
      (if (eof-object? _char581_)
          '#!void
          (let* ((_cs582591_ _cs580_)
                 (_E584595_
                  (lambda () (error '"No clause matching" _cs582591_)))
                 (_K585603_
                  (lambda (_lines598_ _loc599_ _buf600_ _port601_)
                    (##direct-structure-set!
                     _cs580_
                     (cons _char581_ _buf600_)
                     '2
                     std/parser/stream#char-stream::t
                     '#f)
                    (##direct-structure-set!
                     _cs580_
                     (std/parser/stream#location-ungetc
                      _loc599_
                      _char581_
                      _lines598_)
                     '3
                     std/parser/stream#char-stream::t
                     '#f))))
            (if (let ()
                  (declare (not safe))
                  (##structure-direct-instance-of?
                   _cs582591_
                   'std/parser/stream#char-stream::t))
                (let* ((_e586606_
                        (let ()
                          (declare (not safe))
                          (##vector-ref _cs582591_ '1)))
                       (_port609_ _e586606_)
                       (_e587611_
                        (let ()
                          (declare (not safe))
                          (##vector-ref _cs582591_ '2)))
                       (_buf614_ _e587611_)
                       (_e588616_
                        (let ()
                          (declare (not safe))
                          (##vector-ref _cs582591_ '3)))
                       (_loc619_ _e588616_)
                       (_e589621_
                        (let ()
                          (declare (not safe))
                          (##vector-ref _cs582591_ '4)))
                       (_lines624_ _e589621_))
                  (_K585603_ _lines624_ _loc619_ _buf614_ _port609_))
                (_E584595_))))))
  (define std/parser/stream#char-stream-peek
    (lambda (_cs516_)
      (let* ((_cs517524_ _cs516_)
             (_E519528_ (lambda () (error '"No clause matching" _cs517524_)))
             (_K520567_
              (lambda (_buf531_ _port532_)
                (let* ((_buf533541_ _buf531_)
                       (_else535549_ (lambda () (peek-char _port532_)))
                       (_K537555_ (lambda (_rest552_ _char553_) _char553_)))
                  (if (let () (declare (not safe)) (##pair? _buf533541_))
                      (let ((_hd538558_
                             (let () (declare (not safe)) (##car _buf533541_)))
                            (_tl539560_
                             (let ()
                               (declare (not safe))
                               (##cdr _buf533541_))))
                        (let* ((_char563_ _hd538558_) (_rest565_ _tl539560_))
                          (_K537555_ _rest565_ _char563_)))
                      (_else535549_))))))
        (if (let ()
              (declare (not safe))
              (##structure-direct-instance-of?
               _cs517524_
               'std/parser/stream#char-stream::t))
            (let* ((_e521570_
                    (let () (declare (not safe)) (##vector-ref _cs517524_ '1)))
                   (_port573_ _e521570_)
                   (_e522575_
                    (let () (declare (not safe)) (##vector-ref _cs517524_ '2)))
                   (_buf578_ _e522575_))
              (_K520567_ _buf578_ _port573_))
            (_E519528_)))))
  (define std/parser/stream#location-getc
    (lambda (_loc465_ _char466_ _lines467_)
      (let* ((_loc468478_ _loc465_)
             (_E470482_ (lambda () (error '"No clause matching" _loc468478_)))
             (_K471490_
              (lambda (_xoff485_ _col486_ _line487_ _port488_)
                (if (let () (declare (not safe)) (##fx< _xoff485_ '0))
                    (let ()
                      (declare (not safe))
                      (##structure
                       std/parser/base#location::t
                       _port488_
                       '0
                       '0
                       '1
                       '0))
                    (if (memq _xoff485_ _lines467_)
                        (let ((__tmp4498
                               (let ()
                                 (declare (not safe))
                                 (##fx+ _line487_ '1)))
                              (__tmp4497
                               (let ()
                                 (declare (not safe))
                                 (##fx+ _xoff485_ '1))))
                          (declare (not safe))
                          (##structure
                           std/parser/base#location::t
                           _port488_
                           __tmp4498
                           '0
                           '1
                           __tmp4497))
                        (let ((__tmp4500
                               (let ()
                                 (declare (not safe))
                                 (##fx+ _col486_ '1)))
                              (__tmp4499
                               (let ()
                                 (declare (not safe))
                                 (##fx+ _xoff485_ '1))))
                          (declare (not safe))
                          (##structure
                           std/parser/base#location::t
                           _port488_
                           _line487_
                           __tmp4500
                           '1
                           __tmp4499)))))))
        (if (let ()
              (declare (not safe))
              (##structure-direct-instance-of?
               _loc468478_
               'std/parser/base#location::t))
            (let* ((_e472493_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc468478_ '1)))
                   (_port496_ _e472493_)
                   (_e473498_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc468478_ '2)))
                   (_line501_ _e473498_)
                   (_e474503_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc468478_ '3)))
                   (_col506_ _e474503_)
                   (_e475508_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc468478_ '4)))
                   (_e476511_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc468478_ '5)))
                   (_xoff514_ _e476511_))
              (_K471490_ _xoff514_ _col506_ _line501_ _port496_))
            (_E470482_)))))
  (define std/parser/stream#location-ungetc
    (lambda (_loc400_ _char401_ _lines402_)
      (let* ((_loc403413_ _loc400_)
             (_E405417_ (lambda () (error '"No clause matching" _loc403413_)))
             (_K406439_
              (lambda (_xoff420_ _col421_ _line422_ _port423_)
                (if (let () (declare (not safe)) (##fx> _col421_ '0))
                    (let ((__tmp4502
                           (let () (declare (not safe)) (##fx- _col421_ '1)))
                          (__tmp4501
                           (let () (declare (not safe)) (##fx- _xoff420_ '1))))
                      (declare (not safe))
                      (##structure
                       std/parser/base#location::t
                       _port423_
                       _line422_
                       __tmp4502
                       '1
                       __tmp4501))
                    (let* ((_xoff425_
                            (let () (declare (not safe)) (##fx- _xoff420_ '1)))
                           (_base434_
                            (let ((_$e431_ (find (lambda (_g426428_)
                                                   (< _g426428_ _xoff425_))
                                                 _lines402_)))
                              (if _$e431_ _$e431_ '-1)))
                           (_col436_
                            (let ()
                              (declare (not safe))
                              (##fx- _xoff425_ _base434_ '1))))
                      (let ((__tmp4503
                             (let ()
                               (declare (not safe))
                               (##fx- _line422_ '1))))
                        (declare (not safe))
                        (##structure
                         std/parser/base#location::t
                         _port423_
                         __tmp4503
                         _col436_
                         '1
                         _xoff425_)))))))
        (if (let ()
              (declare (not safe))
              (##structure-direct-instance-of?
               _loc403413_
               'std/parser/base#location::t))
            (let* ((_e407442_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc403413_ '1)))
                   (_port445_ _e407442_)
                   (_e408447_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc403413_ '2)))
                   (_line450_ _e408447_)
                   (_e409452_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc403413_ '3)))
                   (_col455_ _e409452_)
                   (_e410457_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc403413_ '4)))
                   (_e411460_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc403413_ '5)))
                   (_xoff463_ _e411460_))
              (_K406439_ _xoff463_ _col455_ _line450_ _port445_))
            (_E405417_)))))
  (define std/parser/stream#port-location
    (lambda (_port391_)
      (let* ((_line393_ (macro-character-port-rlines _port391_))
             (_xoff395_
              (let ((__tmp4505 (macro-character-port-rchars _port391_))
                    (__tmp4504 (macro-character-port-rlo _port391_)))
                (declare (not safe))
                (##fx+ __tmp4505 __tmp4504)))
             (_col397_
              (let ((__tmp4506 (macro-character-port-rcurline _port391_)))
                (declare (not safe))
                (##fx- _xoff395_ __tmp4506))))
        (let ()
          (declare (not safe))
          (##structure
           std/parser/base#location::t
           _port391_
           _line393_
           _col397_
           '1
           _xoff395_))))))
