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