function labels are short by default now.
This commit is contained in:
parent
318255c253
commit
8506b70253
|
@ -1,6 +1,7 @@
|
||||||
#lang typed/racket/base
|
#lang typed/racket/base
|
||||||
(require "lexical-structs.rkt")
|
(require "lexical-structs.rkt")
|
||||||
|
|
||||||
|
|
||||||
(provide (all-defined-out))
|
(provide (all-defined-out))
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,9 +158,16 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(: current-short-labels? (Parameterof Boolean))
|
||||||
|
(define current-short-labels? (make-parameter #t))
|
||||||
|
|
||||||
|
|
||||||
(: make-label (Symbol -> Symbol))
|
(: make-label (Symbol -> Symbol))
|
||||||
(define make-label
|
(define make-label
|
||||||
(let ([n 0])
|
(let ([n 0])
|
||||||
(lambda (l)
|
(lambda (l)
|
||||||
(set! n (add1 n))
|
(set! n (add1 n))
|
||||||
(string->symbol (format "~a~a" l n)))))
|
(if (current-short-labels?)
|
||||||
|
(string->symbol (format "_~a" n))
|
||||||
|
(string->symbol (format "~a~a" l n))))))
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
current-seen-unimplemented-kernel-primitives
|
current-seen-unimplemented-kernel-primitives
|
||||||
current-kernel-module-locator?
|
current-kernel-module-locator?
|
||||||
current-compress-javascript?
|
current-compress-javascript?
|
||||||
current-report-port
|
|
||||||
|
|
||||||
|
current-report-port
|
||||||
current-timing-port
|
current-timing-port
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(: current-report-port (Parameterof Output-Port))
|
(: current-report-port (Parameterof Output-Port))
|
||||||
(define current-report-port (make-parameter (current-output-port)))
|
(define current-report-port (make-parameter (current-output-port)))
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
"../compiler/lexical-structs.rkt"
|
"../compiler/lexical-structs.rkt"
|
||||||
"../helpers.rkt"
|
"../helpers.rkt"
|
||||||
"../parameters.rkt"
|
"../parameters.rkt"
|
||||||
"lam-entry-gensym.rkt"
|
|
||||||
racket/list)
|
racket/list)
|
||||||
|
|
||||||
(provide (rename-out (-parse parse)))
|
(provide (rename-out (-parse parse)))
|
||||||
|
@ -16,6 +15,11 @@
|
||||||
(make-Top prefix (parse exp (extend-lexical-environment '() prefix) #t))))
|
(make-Top prefix (parse exp (extend-lexical-environment '() prefix) #t))))
|
||||||
|
|
||||||
|
|
||||||
|
(define (make-lam-label)
|
||||||
|
(make-label 'lamEntry))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
(define (construct-the-prefix exp)
|
(define (construct-the-prefix exp)
|
||||||
(let ([unbound-names (find-unbound-names exp)]
|
(let ([unbound-names (find-unbound-names exp)]
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
#lang typed/racket/base
|
|
||||||
|
|
||||||
|
|
||||||
(define-values (make-lam-label reset-lam-label-counter!/unit-testing)
|
|
||||||
(let ([n 0])
|
|
||||||
(values
|
|
||||||
(lambda ()
|
|
||||||
(set! n (add1 n))
|
|
||||||
(string->symbol (format "lamEntry~a" n)))
|
|
||||||
(lambda ()
|
|
||||||
(set! n 0)))))
|
|
||||||
|
|
||||||
|
|
||||||
(provide make-lam-label reset-lam-label-counter!/unit-testing)
|
|
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
;; Parsing Racket 5.1.1 bytecode structures into our own structures.
|
;; Parsing Racket 5.1.1 bytecode structures into our own structures.
|
||||||
(require "typed-module-path.rkt"
|
(require "typed-module-path.rkt"
|
||||||
"lam-entry-gensym.rkt"
|
|
||||||
"path-rewriter.rkt"
|
"path-rewriter.rkt"
|
||||||
"../compiler/expression-structs.rkt"
|
"../compiler/expression-structs.rkt"
|
||||||
"../compiler/lexical-structs.rkt"
|
"../compiler/lexical-structs.rkt"
|
||||||
|
@ -24,11 +23,14 @@
|
||||||
racket/list)
|
racket/list)
|
||||||
|
|
||||||
|
|
||||||
(provide parse-bytecode
|
(provide parse-bytecode)
|
||||||
reset-lam-label-counter!/unit-testing)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(define (make-lam-label)
|
||||||
|
(make-label 'lamEntry))
|
||||||
|
|
||||||
|
|
||||||
;; current-module-path-index-resolver: (module-path-index (U Path #f) -> (U Symbol Path)) -> void
|
;; current-module-path-index-resolver: (module-path-index (U Path #f) -> (U Symbol Path)) -> void
|
||||||
;; The module path index resolver figures out how to translate module path indices to module names.
|
;; The module path index resolver figures out how to translate module path indices to module names.
|
||||||
(define current-module-path-index-resolver
|
(define current-module-path-index-resolver
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
|
|
||||||
;; Parsing Racket 5.1.2 bytecode structures into our own structures.
|
;; Parsing Racket 5.1.2 bytecode structures into our own structures.
|
||||||
(require "typed-module-path.rkt"
|
(require "typed-module-path.rkt"
|
||||||
"lam-entry-gensym.rkt"
|
|
||||||
"path-rewriter.rkt"
|
"path-rewriter.rkt"
|
||||||
"../compiler/expression-structs.rkt"
|
"../compiler/expression-structs.rkt"
|
||||||
"../compiler/lexical-structs.rkt"
|
"../compiler/lexical-structs.rkt"
|
||||||
|
@ -26,8 +25,7 @@
|
||||||
racket/list)
|
racket/list)
|
||||||
|
|
||||||
|
|
||||||
(provide parse-bytecode
|
(provide parse-bytecode)
|
||||||
reset-lam-label-counter!/unit-testing)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -465,7 +463,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(define (make-lam-label)
|
||||||
|
(make-label 'lamEntry))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
(define (parse-expr expr)
|
(define (parse-expr expr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user