(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 _$args98923_
      (apply make-struct-instance
             std/parser/base#parse-error::t
             _$args98923_)))
  (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 _$args98920_
      (apply make-struct-instance std/parser/base#token::t _$args98920_)))
  (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 _$args98917_
      (apply make-struct-instance std/parser/base#location::t _$args98917_)))
  (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 (_e98914_ _loc98915_) _e98914_))
  (define std/parser/base#wrap-ast
    (lambda (_e98908_ _loc98909_)
      (if (or (##structure-instance-of? _e98908_ 'gerbil#AST::t)
              (not _loc98909_))
          _e98908_
          (##structure
           AST::t
           _e98908_
           (std/parser/base#location->source-location _loc98909_)))))
  (define std/parser/base#unwrap-ast
    (lambda (_e98906_)
      (if (##structure-instance-of? _e98906_ 'gerbil#AST::t)
          (##structure-ref _e98906_ '1 AST::t '#f)
          _e98906_)))
  (define std/parser/base#token->syntax
    (lambda (_tok98863_)
      (let* ((_tok9886498873_ _tok98863_)
             (_else9886698881_ (lambda () _tok98863_))
             (_K9886898888_
              (lambda (_loc98884_ _e98885_ _t98886_)
                (std/parser/base#wrap-ast
                 (cons _t98886_ (cons _e98885_ '()))
                 _loc98884_))))
        (if (##structure-direct-instance-of?
             _tok9886498873_
             'std/parser/base#token::t)
            (let* ((_e9886998891_ (##vector-ref _tok9886498873_ '1))
                   (_t98894_ _e9886998891_)
                   (_e9887098896_ (##vector-ref _tok9886498873_ '2))
                   (_e98899_ _e9887098896_)
                   (_e9887198901_ (##vector-ref _tok9886498873_ '3))
                   (_loc98904_ _e9887198901_))
              (_K9886898888_ _loc98904_ _e98899_ _t98894_))
            (_else9886698881_)))))
  (define std/parser/base#raise-parse-error
    (lambda (_where98858_ _msg98859_ _tok98860_ . _rest98861_)
      (raise (make-struct-instance
              std/parser/base#parse-error::t
              _msg98859_
              (cons _tok98860_ _rest98861_)
              _where98858_))))
  (define std/parser/base#parse-error::display-exception
    (lambda (_self98712_ _port98713_)
      (let* ((_self9871498722_ _self98712_)
             (_E9871698726_
              (lambda () (error '"No clause matching" _self9871498722_)))
             (_K9871798840_
              (lambda (_where98729_ _irritants98730_ _msg98731_)
                (let* ((_irritants9873298743_ _irritants98730_)
                       (_else9873498753_
                        (lambda ()
                          (if _where98729_
                              (displayln
                               '"Parse error at "
                               _where98729_
                               '": "
                               _msg98731_)
                              (displayln '"Parse error: " _msg98731_))
                          (if (null? _irritants98730_)
                              '#!void
                              (begin
                                (display '"--- irritants: ")
                                (for-each
                                 (lambda (_obj98751_)
                                   (write _obj98751_)
                                   (display '" "))
                                 _irritants98730_)))))
                       (_K9873698815_
                        (lambda (_rest98756_ _loc98757_ _e98758_ _t98759_)
                          (call-with-parameters
                           (lambda ()
                             (displayln '"Parse Error")
                             (display '"*** ERROR IN ")
                             (if _loc98757_
                                 (std/parser/base#display-location__%
                                  _loc98757_
                                  _port98713_)
                                 (display '"?"))
                             (newline)
                             (display '"--- Parse error")
                             (if _where98729_
                                 (begin
                                   (display '" at ")
                                   (display _where98729_))
                                 '#!void)
                             (displayln '": " _msg98731_)
                             (display '"... token: (")
                             (display _t98759_)
                             (display '" ")
                             (write _e98758_)
                             (displayln '")")
                             (if (null? _rest98756_)
                                 '#!void
                                 (for-each
                                  (lambda (_e9876198763_)
                                    (let* ((_g9876598775_ _e9876198763_)
                                           (_E9876898779_
                                            (lambda ()
                                              (error '"No clause matching"
                                                     _g9876598775_))))
                                      (let ((_K9877098797_
                                             (lambda (_loc98793_
                                                      _e98794_
                                                      _t98795_)
                                               (display '"... detail: ")
                                               (display '"(")
                                               (display _t98795_)
                                               (display '" ")
                                               (write _e98794_)
                                               (display '")")
                                               (if _loc98793_
                                                   (begin
                                                     (display '" at ")
                                                     (std/parser/base#display-location__0
                                                      _loc98793_))
                                                   '#!void)
                                               (newline)))
                                            (_K9876998785_
                                             (lambda (_obj98783_)
                                               (write _obj98783_)
                                               (newline))))
                                        (if (##structure-direct-instance-of?
                                             _g9876598775_
                                             'std/parser/base#token::t)
                                            (let* ((_e9877198800_
                                                    (##vector-ref
                                                     _g9876598775_
                                                     '1))
                                                   (_e9877298805_
                                                    (##vector-ref
                                                     _g9876598775_
                                                     '2))
                                                   (_e9877398810_
                                                    (##vector-ref
                                                     _g9876598775_
                                                     '3)))
                                              (let ((_t98803_ _e9877198800_)
                                                    (_e98808_ _e9877298805_)
                                                    (_loc98813_ _e9877398810_))
                                                (_K9877098797_
                                                 _loc98813_
                                                 _e98808_
                                                 _t98803_)))
                                            (let ((_obj98788_ _g9876598775_))
                                              (_K9876998785_ _obj98788_))))))
                                  _rest98756_)))
                           current-output-port
                           _port98713_))))
                  (if (##pair? _irritants9873298743_)
                      (let ((_hd9873798818_ (##car _irritants9873298743_))
                            (_tl9873898820_ (##cdr _irritants9873298743_)))
                        (if (##structure-direct-instance-of?
                             _hd9873798818_
                             'std/parser/base#token::t)
                            (let* ((_e9873998823_
                                    (##vector-ref _hd9873798818_ '1))
                                   (_t98826_ _e9873998823_)
                                   (_e9874098828_
                                    (##vector-ref _hd9873798818_ '2))
                                   (_e98831_ _e9874098828_)
                                   (_e9874198833_
                                    (##vector-ref _hd9873798818_ '3))
                                   (_loc98836_ _e9874198833_)
                                   (_rest98838_ _tl9873898820_))
                              (_K9873698815_
                               _rest98838_
                               _loc98836_
                               _e98831_
                               _t98826_))
                            (_else9873498753_)))
                      (_else9873498753_))))))
        (if (##structure-instance-of?
             _self9871498722_
             'std/parser/base#parse-error::t)
            (if (##fx< '3 (##vector-length _self9871498722_))
                (let* ((_e9871898843_ (##vector-ref _self9871498722_ '1))
                       (_msg98846_ _e9871898843_)
                       (_e9871998848_ (##vector-ref _self9871498722_ '2))
                       (_irritants98851_ _e9871998848_)
                       (_e9872098853_ (##vector-ref _self9871498722_ '3))
                       (_where98856_ _e9872098853_))
                  (_K9871798840_ _where98856_ _irritants98851_ _msg98846_))
                (_E9871698726_))
            (_E9871698726_)))))
  (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 (_loc98539_)
      (let* ((_loc9854098549_ _loc98539_)
             (_E9854298553_
              (lambda () (error '"No clause matching" _loc9854098549_)))
             (_K9854398566_
              (lambda (_off98556_ _col98557_ _line98558_ _port98559_)
                (let* ((_container98561_
                        (##port-name->container (##port-name _port98559_)))
                       (_filepos98563_
                        (##make-filepos _line98558_ _col98557_ _off98556_)))
                  (##make-locat _container98561_ _filepos98563_)))))
        (if (##structure-direct-instance-of?
             _loc9854098549_
             'std/parser/base#location::t)
            (let* ((_e9854498569_ (##vector-ref _loc9854098549_ '1))
                   (_port98572_ _e9854498569_)
                   (_e9854598574_ (##vector-ref _loc9854098549_ '2))
                   (_line98577_ _e9854598574_)
                   (_e9854698579_ (##vector-ref _loc9854098549_ '3))
                   (_col98582_ _e9854698579_)
                   (_e9854798584_ (##vector-ref _loc9854098549_ '4))
                   (_off98587_ _e9854798584_))
              (_K9854398566_ _off98587_ _col98582_ _line98577_ _port98572_))
            (_E9854298553_)))))
  (define std/parser/base#display-location__%
    (lambda (_loc98526_ _port98527_)
      (##display-locat
       (std/parser/base#location->source-location _loc98526_)
       '#t
       _port98527_)))
  (define std/parser/base#display-location__0
    (lambda (_loc98532_)
      (let ((_port98534_ (current-output-port)))
        (std/parser/base#display-location__% _loc98532_ _port98534_))))
  (define std/parser/base#display-location
    (lambda _g98935_
      (let ((_g98934_ (length _g98935_)))
        (cond ((##fx= _g98934_ 1)
               (apply std/parser/base#display-location__0 _g98935_))
              ((##fx= _g98934_ 2)
               (apply std/parser/base#display-location__% _g98935_))
              (else
               (##raise-wrong-number-of-arguments-exception
                std/parser/base#display-location
                _g98935_))))))
  (define std/parser/base#location-delta
    (lambda (_start98446_ _end98447_)
      (let ((_start9844898464_ _start98446_) (_end9844998466_ _end98447_))
        (let* ((_E9845198470_
                (lambda ()
                  (error '"No clause matching"
                         _start9844898464_
                         _end9844998466_)))
               (_K9845298480_
                (lambda (_xoff98473_
                         _col98474_
                         _line98475_
                         _port98476_
                         _exoff98477_
                         _eoff98478_)
                  (##structure
                   std/parser/base#location::t
                   _port98476_
                   _line98475_
                   _col98474_
                   (##fx+ (##fx- _exoff98477_ _xoff98473_) _eoff98478_)
                   _xoff98473_))))
          (if (##structure-direct-instance-of?
               _start9844898464_
               'std/parser/base#location::t)
              (let* ((_e9845898483_ (##vector-ref _start9844898464_ '1))
                     (_port98486_ _e9845898483_)
                     (_e9845998488_ (##vector-ref _start9844898464_ '2))
                     (_line98491_ _e9845998488_)
                     (_e9846098493_ (##vector-ref _start9844898464_ '3))
                     (_col98496_ _e9846098493_)
                     (_e9846198498_ (##vector-ref _start9844898464_ '4))
                     (_e9846298501_ (##vector-ref _start9844898464_ '5))
                     (_xoff98504_ _e9846298501_))
                (if (##structure-direct-instance-of?
                     _end9844998466_
                     'std/parser/base#location::t)
                    (let* ((_e9845398506_ (##vector-ref _end9844998466_ '1))
                           (_e9845498509_ (##vector-ref _end9844998466_ '2))
                           (_e9845598512_ (##vector-ref _end9844998466_ '3))
                           (_e9845698515_ (##vector-ref _end9844998466_ '4))
                           (_eoff98518_ _e9845698515_)
                           (_e9845798520_ (##vector-ref _end9844998466_ '5))
                           (_exoff98523_ _e9845798520_))
                      (_K9845298480_
                       _xoff98504_
                       _col98496_
                       _line98491_
                       _port98486_
                       _exoff98523_
                       _eoff98518_))
                    (_E9845198470_)))
              (_E9845198470_))))))
  (define std/parser/base#location-delta*
    (lambda (_start98370_ _end98371_)
      (let ((_start9837298388_ _start98370_) (_end9837398390_ _end98371_))
        (let* ((_E9837598394_
                (lambda ()
                  (error '"No clause matching"
                         _start9837298388_
                         _end9837398390_)))
               (_K9837698403_
                (lambda (_xoff98397_
                         _col98398_
                         _line98399_
                         _port98400_
                         _exoff98401_)
                  (##structure
                   std/parser/base#location::t
                   _port98400_
                   _line98399_
                   _col98398_
                   (##fx- _exoff98401_ _xoff98397_)
                   _xoff98397_))))
          (if (##structure-direct-instance-of?
               _start9837298388_
               'std/parser/base#location::t)
              (let* ((_e9838298406_ (##vector-ref _start9837298388_ '1))
                     (_port98409_ _e9838298406_)
                     (_e9838398411_ (##vector-ref _start9837298388_ '2))
                     (_line98414_ _e9838398411_)
                     (_e9838498416_ (##vector-ref _start9837298388_ '3))
                     (_col98419_ _e9838498416_)
                     (_e9838598421_ (##vector-ref _start9837298388_ '4))
                     (_e9838698424_ (##vector-ref _start9837298388_ '5))
                     (_xoff98427_ _e9838698424_))
                (if (##structure-direct-instance-of?
                     _end9837398390_
                     'std/parser/base#location::t)
                    (let* ((_e9837798429_ (##vector-ref _end9837398390_ '1))
                           (_e9837898432_ (##vector-ref _end9837398390_ '2))
                           (_e9837998435_ (##vector-ref _end9837398390_ '3))
                           (_e9838098438_ (##vector-ref _end9837398390_ '4))
                           (_e9838198441_ (##vector-ref _end9837398390_ '5))
                           (_exoff98444_ _e9838198441_))
                      (_K9837698403_
                       _xoff98427_
                       _col98419_
                       _line98414_
                       _port98409_
                       _exoff98444_))
                    (_E9837598394_)))
              (_E9837598394_)))))))
