(module config mzscheme
(require (all-except (planet "list.ss" ("dherman" "list.plt" 1 0)) any)
(planet "contract-utils.ss" ("cobbe" "contract-utils.plt" 1 0))
(lib "contract.ss")
"settings.ss")
(define default-keywords
'(break case catch const continue
debugger default delete do else enum
false finally for function if instanceof in
new null return switch this throw true
try typeof var void while with))
(define (keyword-guard kw)
(lambda (v)
(if v (add-keyword kw) (remove-keyword kw))))
(define (add-keyword kw)
(lexical-keywords (lset-adjoin eq? (lexical-keywords) kw)))
(define (remove-keyword kw)
(lexical-keywords (filter (lambda (k)
(not (eq? k kw)))
(lexical-keywords))))
(define current-debug-port (make-parameter (current-error-port)))
(provide-settings (settings current-settings default-settings)
(allow-anonymous-function-source-elements? #t boolean?)
(infer-do-while-semicolon? #f boolean?)
(enable-extended-catch-statements? #f boolean?)
(allow-nested-function-declarations? #f boolean?)
(proper-tail-recursion? #f boolean?)
(stack-limit #f (optional/c natural-number/c))
(allow-eval-aliasing? #f boolean?)
(code-representation 'standard (symbols 'standard 'sexp))
(lexical-keywords default-keywords (listof symbol?))
(enable-let-expressions? #t boolean?
(keyword-guard 'let))
(debug-destination 'error-port (symbols 'error-port 'debug-window))
(debug-scope-resolution? #f boolean?)
(debug-unbound-references? #f boolean?))
(define (ecma-strict? flag)
(let ([non-strict? (not flag)])
(allow-anonymous-function-source-elements? non-strict?)
(infer-do-while-semicolon? non-strict?)
(enable-extended-catch-statements? non-strict?)
(allow-nested-function-declarations? non-strict?)))
(define (default-settings? s)
(equal? s default-settings))
(provide/contract [current-debug-port parameter?]
[ecma-strict? (boolean? . -> . any)]
[default-settings? (settings? . -> . boolean?)]
[marshall-settings (settings? . -> . any)]
[unmarshall-settings (any/c . -> . settings?)]))