function labels are short by default now.

This commit is contained in:
Danny Yoo 2011-09-14 22:03:24 -04:00
parent 318255c253
commit 8506b70253
6 changed files with 25 additions and 24 deletions

View File

@ -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))))))

View File

@ -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)))

View File

@ -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)]

View File

@ -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)

View File

@ -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

View File

@ -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,7 +463,9 @@
(define (make-lam-label)
(make-label 'lamEntry))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (parse-expr expr)