(declare (block) (standard-bindings) (extended-bindings))
(begin
  (define std/parser/base#parse-error::t
    (make-struct-type
     'std/parser/base#parse-error::t
     error::t
     '0
     'parse-error
     '()
     '#f
     '()))
  (define std/parser/base#parse-error?
    (make-struct-predicate std/parser/base#parse-error::t))
  (define std/parser/base#make-parse-error
    (lambda _$args944_
      (apply make-struct-instance std/parser/base#parse-error::t _$args944_)))
  (define std/parser/base#token::t
    (make-struct-type
     'std/parser/base#token::t
     '#f
     '3
     'token
     '((final: . #t))
     '#f
     '(t e loc)))
  (define std/parser/base#token?
    (make-struct-predicate std/parser/base#token::t))
  (define std/parser/base#make-token
    (lambda _$args941_
      (apply make-struct-instance std/parser/base#token::t _$args941_)))
  (define std/parser/base#token-t
    (make-struct-field-accessor std/parser/base#token::t '0))
  (define std/parser/base#token-e
    (make-struct-field-accessor std/parser/base#token::t '1))
  (define std/parser/base#token-loc
    (make-struct-field-accessor std/parser/base#token::t '2))
  (define std/parser/base#token-t-set!
    (make-struct-field-mutator std/parser/base#token::t '0))
  (define std/parser/base#token-e-set!
    (make-struct-field-mutator std/parser/base#token::t '1))
  (define std/parser/base#token-loc-set!
    (make-struct-field-mutator std/parser/base#token::t '2))
  (define std/parser/base#location::t
    (make-struct-type
     'std/parser/base#location::t
     '#f
     '5
     'location
     '((final: . #t))
     '#f
     '(port line col off xoff)))
  (define std/parser/base#location?
    (make-struct-predicate std/parser/base#location::t))
  (define std/parser/base#make-location
    (lambda _$args938_
      (apply make-struct-instance std/parser/base#location::t _$args938_)))
  (define std/parser/base#location-port
    (make-struct-field-accessor std/parser/base#location::t '0))
  (define std/parser/base#location-line
    (make-struct-field-accessor std/parser/base#location::t '1))
  (define std/parser/base#location-col
    (make-struct-field-accessor std/parser/base#location::t '2))
  (define std/parser/base#location-off
    (make-struct-field-accessor std/parser/base#location::t '3))
  (define std/parser/base#location-xoff
    (make-struct-field-accessor std/parser/base#location::t '4))
  (define std/parser/base#location-port-set!
    (make-struct-field-mutator std/parser/base#location::t '0))
  (define std/parser/base#location-line-set!
    (make-struct-field-mutator std/parser/base#location::t '1))
  (define std/parser/base#location-col-set!
    (make-struct-field-mutator std/parser/base#location::t '2))
  (define std/parser/base#location-off-set!
    (make-struct-field-mutator std/parser/base#location::t '3))
  (define std/parser/base#location-xoff-set!
    (make-struct-field-mutator std/parser/base#location::t '4))
  (define std/parser/base#wrap-identity (lambda (_e935_ _loc936_) _e935_))
  (define std/parser/base#wrap-ast
    (lambda (_e929_ _loc930_)
      (if (or (let ()
                (declare (not safe))
                (##structure-instance-of? _e929_ 'gerbil#AST::t))
              (not _loc930_))
          _e929_
          (let ((__tmp4591
                 (std/parser/base#location->source-location _loc930_)))
            (declare (not safe))
            (##structure AST::t _e929_ __tmp4591)))))
  (define std/parser/base#unwrap-ast
    (lambda (_e927_)
      (if (let ()
            (declare (not safe))
            (##structure-instance-of? _e927_ 'gerbil#AST::t))
          (##structure-ref _e927_ '1 AST::t '#f)
          _e927_)))
  (define std/parser/base#token->syntax
    (lambda (_tok884_)
      (let* ((_tok885894_ _tok884_)
             (_else887902_ (lambda () _tok884_))
             (_K889909_
              (lambda (_loc905_ _e906_ _t907_)
                (std/parser/base#wrap-ast
                 (cons _t907_ (cons _e906_ '()))
                 _loc905_))))
        (if (let ()
              (declare (not safe))
              (##structure-direct-instance-of?
               _tok885894_
               'std/parser/base#token::t))
            (let* ((_e890912_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _tok885894_ '1)))
                   (_t915_ _e890912_)
                   (_e891917_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _tok885894_ '2)))
                   (_e920_ _e891917_)
                   (_e892922_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _tok885894_ '3)))
                   (_loc925_ _e892922_))
              (_K889909_ _loc925_ _e920_ _t915_))
            (_else887902_)))))
  (define std/parser/base#raise-parse-error
    (lambda (_where879_ _msg880_ _tok881_ . _rest882_)
      (raise (make-struct-instance
              std/parser/base#parse-error::t
              _msg880_
              (cons _tok881_ _rest882_)
              _where879_))))
  (define std/parser/base#parse-error::display-exception
    (lambda (_self733_ _port734_)
      (let* ((_self735743_ _self733_)
             (_E737747_ (lambda () (error '"No clause matching" _self735743_)))
             (_K738861_
              (lambda (_where750_ _irritants751_ _msg752_)
                (let* ((_irritants753764_ _irritants751_)
                       (_else755774_
                        (lambda ()
                          (if _where750_
                              (displayln
                               '"Parse error at "
                               _where750_
                               '": "
                               _msg752_)
                              (displayln '"Parse error: " _msg752_))
                          (if (null? _irritants751_)
                              '#!void
                              (begin
                                (display '"--- irritants: ")
                                (for-each
                                 (lambda (_obj772_)
                                   (write _obj772_)
                                   (display '" "))
                                 _irritants751_)))))
                       (_K757836_
                        (lambda (_rest777_ _loc778_ _e779_ _t780_)
                          (call-with-parameters
                           (lambda ()
                             (displayln '"Parse Error")
                             (display '"*** ERROR IN ")
                             (if _loc778_
                                 (std/parser/base#display-location__%
                                  _loc778_
                                  _port734_)
                                 (display '"?"))
                             (newline)
                             (display '"--- Parse error")
                             (if _where750_
                                 (begin (display '" at ") (display _where750_))
                                 '#!void)
                             (displayln '": " _msg752_)
                             (display '"... token: (")
                             (display _t780_)
                             (display '" ")
                             (write _e779_)
                             (displayln '")")
                             (if (null? _rest777_)
                                 '#!void
                                 (for-each
                                  (lambda (_e782784_)
                                    (let* ((_g786796_ _e782784_)
                                           (_E789800_
                                            (lambda ()
                                              (error '"No clause matching"
                                                     _g786796_))))
                                      (let ((_K791818_
                                             (lambda (_loc814_ _e815_ _t816_)
                                               (display '"... detail: ")
                                               (display '"(")
                                               (display _t816_)
                                               (display '" ")
                                               (write _e815_)
                                               (display '")")
                                               (if _loc814_
                                                   (begin
                                                     (display '" at ")
                                                     (std/parser/base#display-location__0
                                                      _loc814_))
                                                   '#!void)
                                               (newline)))
                                            (_K790806_
                                             (lambda (_obj804_)
                                               (write _obj804_)
                                               (newline))))
                                        (if (let ()
                                              (declare (not safe))
                                              (##structure-direct-instance-of?
                                               _g786796_
                                               'std/parser/base#token::t))
                                            (let* ((_e792821_
                                                    (let ()
                                                      (declare (not safe))
                                                      (##vector-ref
                                                       _g786796_
                                                       '1)))
                                                   (_e793826_
                                                    (let ()
                                                      (declare (not safe))
                                                      (##vector-ref
                                                       _g786796_
                                                       '2)))
                                                   (_e794831_
                                                    (let ()
                                                      (declare (not safe))
                                                      (##vector-ref
                                                       _g786796_
                                                       '3))))
                                              (let ((_t824_ _e792821_)
                                                    (_e829_ _e793826_)
                                                    (_loc834_ _e794831_))
                                                (_K791818_
                                                 _loc834_
                                                 _e829_
                                                 _t824_)))
                                            (let ((_obj809_ _g786796_))
                                              (_K790806_ _obj809_))))))
                                  _rest777_)))
                           current-output-port
                           _port734_))))
                  (if (let () (declare (not safe)) (##pair? _irritants753764_))
                      (let ((_hd758839_
                             (let ()
                               (declare (not safe))
                               (##car _irritants753764_)))
                            (_tl759841_
                             (let ()
                               (declare (not safe))
                               (##cdr _irritants753764_))))
                        (if (let ()
                              (declare (not safe))
                              (##structure-direct-instance-of?
                               _hd758839_
                               'std/parser/base#token::t))
                            (let* ((_e760844_
                                    (let ()
                                      (declare (not safe))
                                      (##vector-ref _hd758839_ '1)))
                                   (_t847_ _e760844_)
                                   (_e761849_
                                    (let ()
                                      (declare (not safe))
                                      (##vector-ref _hd758839_ '2)))
                                   (_e852_ _e761849_)
                                   (_e762854_
                                    (let ()
                                      (declare (not safe))
                                      (##vector-ref _hd758839_ '3)))
                                   (_loc857_ _e762854_)
                                   (_rest859_ _tl759841_))
                              (_K757836_ _rest859_ _loc857_ _e852_ _t847_))
                            (_else755774_)))
                      (_else755774_))))))
        (if (let ()
              (declare (not safe))
              (##structure-instance-of?
               _self735743_
               'std/parser/base#parse-error::t))
            (if (let ((__tmp4592
                       (let ()
                         (declare (not safe))
                         (##vector-length _self735743_))))
                  (declare (not safe))
                  (##fx< '3 __tmp4592))
                (let* ((_e739864_
                        (let ()
                          (declare (not safe))
                          (##vector-ref _self735743_ '1)))
                       (_msg867_ _e739864_)
                       (_e740869_
                        (let ()
                          (declare (not safe))
                          (##vector-ref _self735743_ '2)))
                       (_irritants872_ _e740869_)
                       (_e741874_
                        (let ()
                          (declare (not safe))
                          (##vector-ref _self735743_ '3)))
                       (_where877_ _e741874_))
                  (_K738861_ _where877_ _irritants872_ _msg867_))
                (_E737747_))
            (_E737747_)))))
  (bind-method!
   std/parser/base#parse-error::t
   'display-exception
   std/parser/base#parse-error::display-exception
   '#f)
  (define std/parser/base#location->source-location
    (lambda (_loc559_)
      (let* ((_loc560569_ _loc559_)
             (_E562573_ (lambda () (error '"No clause matching" _loc560569_)))
             (_K563586_
              (lambda (_off576_ _col577_ _line578_ _port579_)
                (let* ((_container581_
                        (let ((__tmp4593
                               (let ()
                                 (declare (not safe))
                                 (##port-name _port579_))))
                          (declare (not safe))
                          (##port-name->container __tmp4593)))
                       (_filepos583_
                        (let ()
                          (declare (not safe))
                          (##make-filepos _line578_ _col577_ _off576_))))
                  (let ()
                    (declare (not safe))
                    (##make-locat _container581_ _filepos583_))))))
        (if (let ()
              (declare (not safe))
              (##structure-direct-instance-of?
               _loc560569_
               'std/parser/base#location::t))
            (let* ((_e564589_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc560569_ '1)))
                   (_port592_ _e564589_)
                   (_e565594_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc560569_ '2)))
                   (_line597_ _e565594_)
                   (_e566599_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc560569_ '3)))
                   (_col602_ _e566599_)
                   (_e567604_
                    (let ()
                      (declare (not safe))
                      (##vector-ref _loc560569_ '4)))
                   (_off607_ _e567604_))
              (_K563586_ _off607_ _col602_ _line597_ _port592_))
            (_E562573_)))))
  (define std/parser/base#display-location__%
    (lambda (_loc546_ _port547_)
      (let ((__tmp4594 (std/parser/base#location->source-location _loc546_)))
        (declare (not safe))
        (##display-locat __tmp4594 '#t _port547_))))
  (define std/parser/base#display-location__0
    (lambda (_loc552_)
      (let ((_port554_ (current-output-port)))
        (std/parser/base#display-location__% _loc552_ _port554_))))
  (define std/parser/base#display-location
    (lambda _g4596_
      (let ((_g4595_ (let () (declare (not safe)) (##length _g4596_))))
        (cond ((let () (declare (not safe)) (##fx= _g4595_ 1))
               (apply std/parser/base#display-location__0 _g4596_))
              ((let () (declare (not safe)) (##fx= _g4595_ 2))
               (apply std/parser/base#display-location__% _g4596_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/parser/base#display-location
                _g4596_))))))
  (define std/parser/base#location-delta
    (lambda (_start466_ _end467_)
      (let ((_start468484_ _start466_) (_end469486_ _end467_))
        (let* ((_E471490_
                (lambda ()
                  (error '"No clause matching" _start468484_ _end469486_)))
               (_K472500_
                (lambda (_xoff493_
                         _col494_
                         _line495_
                         _port496_
                         _exoff497_
                         _eoff498_)
                  (let ((__tmp4597
                         (let ((__tmp4598
                                (let ()
                                  (declare (not safe))
                                  (##fx- _exoff497_ _xoff493_))))
                           (declare (not safe))
                           (##fx+ __tmp4598 _eoff498_))))
                    (declare (not safe))
                    (##structure
                     std/parser/base#location::t
                     _port496_
                     _line495_
                     _col494_
                     __tmp4597
                     _xoff493_)))))
          (if (let ()
                (declare (not safe))
                (##structure-direct-instance-of?
                 _start468484_
                 'std/parser/base#location::t))
              (let* ((_e478503_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start468484_ '1)))
                     (_port506_ _e478503_)
                     (_e479508_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start468484_ '2)))
                     (_line511_ _e479508_)
                     (_e480513_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start468484_ '3)))
                     (_col516_ _e480513_)
                     (_e481518_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start468484_ '4)))
                     (_e482521_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start468484_ '5)))
                     (_xoff524_ _e482521_))
                (if (let ()
                      (declare (not safe))
                      (##structure-direct-instance-of?
                       _end469486_
                       'std/parser/base#location::t))
                    (let* ((_e473526_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end469486_ '1)))
                           (_e474529_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end469486_ '2)))
                           (_e475532_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end469486_ '3)))
                           (_e476535_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end469486_ '4)))
                           (_eoff538_ _e476535_)
                           (_e477540_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end469486_ '5)))
                           (_exoff543_ _e477540_))
                      (_K472500_
                       _xoff524_
                       _col516_
                       _line511_
                       _port506_
                       _exoff543_
                       _eoff538_))
                    (_E471490_)))
              (_E471490_))))))
  (define std/parser/base#location-delta*
    (lambda (_start390_ _end391_)
      (let ((_start392408_ _start390_) (_end393410_ _end391_))
        (let* ((_E395414_
                (lambda ()
                  (error '"No clause matching" _start392408_ _end393410_)))
               (_K396423_
                (lambda (_xoff417_ _col418_ _line419_ _port420_ _exoff421_)
                  (let ((__tmp4599
                         (let ()
                           (declare (not safe))
                           (##fx- _exoff421_ _xoff417_))))
                    (declare (not safe))
                    (##structure
                     std/parser/base#location::t
                     _port420_
                     _line419_
                     _col418_
                     __tmp4599
                     _xoff417_)))))
          (if (let ()
                (declare (not safe))
                (##structure-direct-instance-of?
                 _start392408_
                 'std/parser/base#location::t))
              (let* ((_e402426_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start392408_ '1)))
                     (_port429_ _e402426_)
                     (_e403431_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start392408_ '2)))
                     (_line434_ _e403431_)
                     (_e404436_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start392408_ '3)))
                     (_col439_ _e404436_)
                     (_e405441_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start392408_ '4)))
                     (_e406444_
                      (let ()
                        (declare (not safe))
                        (##vector-ref _start392408_ '5)))
                     (_xoff447_ _e406444_))
                (if (let ()
                      (declare (not safe))
                      (##structure-direct-instance-of?
                       _end393410_
                       'std/parser/base#location::t))
                    (let* ((_e397449_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end393410_ '1)))
                           (_e398452_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end393410_ '2)))
                           (_e399455_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end393410_ '3)))
                           (_e400458_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end393410_ '4)))
                           (_e401461_
                            (let ()
                              (declare (not safe))
                              (##vector-ref _end393410_ '5)))
                           (_exoff464_ _e401461_))
                      (_K396423_
                       _xoff447_
                       _col439_
                       _line434_
                       _port429_
                       _exoff464_))
                    (_E395414_)))
              (_E395414_)))))))
