perplexed: earley is failing, but not sure why
This commit is contained in:
parent
70eaf2c055
commit
fff511672d
|
@ -84,10 +84,11 @@
|
|||
(make-bootstrapped-primitive-code
|
||||
'map
|
||||
'(letrec ([map (lambda (f l)
|
||||
(if (null? l)
|
||||
null
|
||||
(cons (f (car l))
|
||||
(map f (cdr l)))))])
|
||||
(displayln "in map")
|
||||
(if (null? l)
|
||||
null
|
||||
(cons (f (car l))
|
||||
(map f (cdr l)))))])
|
||||
map))
|
||||
|
||||
(make-bootstrapped-primitive-code
|
||||
|
|
|
@ -863,7 +863,6 @@
|
|||
(append-instruction-sequences
|
||||
(make-instruction-sequence
|
||||
`(,(Lam-entry-label exp)))
|
||||
|
||||
maybe-unsplice-rest-argument
|
||||
maybe-install-closure-values
|
||||
lam-body-code)))
|
||||
|
|
|
@ -154,10 +154,10 @@
|
|||
(eq? x y)))
|
||||
|
||||
|
||||
(provide-stub-function #;xml->s-exp
|
||||
#;js-object?
|
||||
|
||||
write
|
||||
;; Many of these should be pushed upward rather than stubbed, so that
|
||||
;; Racket's compiler can optimize these.
|
||||
(provide-stub-function write
|
||||
display
|
||||
newline
|
||||
current-print
|
||||
|
@ -165,7 +165,7 @@
|
|||
continuation-mark-set?
|
||||
continuation-mark-set->list
|
||||
for-each
|
||||
;; make-thread-cell
|
||||
|
||||
make-struct-type
|
||||
make-struct-field-accessor
|
||||
make-struct-field-mutator
|
||||
|
|
|
@ -259,6 +259,11 @@
|
|||
|
||||
[(CheckToplevelBound!? op)
|
||||
(let: ([a-top : toplevel (ensure-toplevel (env-ref m (CheckToplevelBound!-depth op)))])
|
||||
(when (> (CheckToplevelBound!-pos op)
|
||||
(length (toplevel-vals a-top)))
|
||||
(printf "ERROR: toplevel is length ~s, but trying to refer to ~s"
|
||||
(length (toplevel-vals a-top))
|
||||
(CheckToplevelBound!-pos op)))
|
||||
(cond
|
||||
[(undefined? (list-ref (toplevel-vals a-top) (CheckToplevelBound!-pos op)))
|
||||
(error 'check-toplevel-bound! "Unbound identifier ~s"
|
||||
|
|
|
@ -349,7 +349,8 @@
|
|||
(even? 1023)
|
||||
(even? 2172)
|
||||
(even? 2171)))
|
||||
(list #t #f #t #f))
|
||||
(list #t #f #t #f)
|
||||
#:with-bootstrapping? #t)
|
||||
|
||||
|
||||
|
||||
|
@ -404,6 +405,13 @@
|
|||
0))
|
||||
|
||||
|
||||
|
||||
(test '(map (lambda (x) (* x x))
|
||||
'(1 2 3 4 5))
|
||||
'(1 4 9 16 25)
|
||||
#:with-bootstrapping? #t)
|
||||
|
||||
|
||||
;; Foldl
|
||||
(test '(let()
|
||||
(define (foldl f acc lst)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#lang racket/base
|
||||
|
||||
(require (prefix-in racket: racket/base)
|
||||
racket/runtime-path
|
||||
"compiler-structs.rkt"
|
||||
"compiler.rkt"
|
||||
"parse-bytecode-5.1.1.rkt"
|
||||
|
@ -9,11 +10,16 @@
|
|||
|
||||
(provide parse run-compiler)
|
||||
|
||||
(define-runtime-path kernel-language-path
|
||||
"lang/kernel.rkt")
|
||||
|
||||
|
||||
;; Use Racket's compiler, and then parse the resulting bytecode
|
||||
;; to our own AST structures.
|
||||
(define (parse stx)
|
||||
(parameterize ([current-namespace (lookup-language-namespace 'racket/base)])
|
||||
(parameterize ([current-namespace (lookup-language-namespace
|
||||
`(file ,(path->string kernel-language-path))
|
||||
#;'racket/base)])
|
||||
(let ([bc (racket:compile stx)]
|
||||
[op (open-output-bytes)])
|
||||
(write bc op)
|
||||
|
|
Loading…
Reference in New Issue
Block a user