mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 16:00:22 +02:00
repl compiles with warnings by default
* module/system/repl/command.scm (compile): Remove the bitrotten options. * module/system/repl/common.scm (repl-default-options): Add 'compile-options option. (repl-compile-options): Accessor for compile-options. (repl-compile): Use repl-compile-options. (repl-eval): Adapt to repl-compile interface change.
This commit is contained in:
parent
a5f9384211
commit
35d70eccac
2 changed files with 14 additions and 19 deletions
|
@ -333,17 +333,10 @@ Change languages."
|
|||
;;; Compile commands
|
||||
;;;
|
||||
|
||||
(define-meta-command (compile repl (form) . opts)
|
||||
(define-meta-command (compile repl (form))
|
||||
"compile FORM
|
||||
Generate compiled code.
|
||||
|
||||
-e Stop after expanding syntax/macro
|
||||
-t Stop after translating into GHIL
|
||||
-c Stop after generating GLIL
|
||||
|
||||
-O Enable optimization
|
||||
-D Add debug information"
|
||||
(let ((x (apply repl-compile repl (repl-parse repl form) opts)))
|
||||
Generate compiled code."
|
||||
(let ((x (repl-compile repl (repl-parse repl form))))
|
||||
(cond ((objcode? x) (guile:disassemble x))
|
||||
(else (repl-print repl x)))))
|
||||
|
||||
|
|
|
@ -102,7 +102,8 @@ See <http://www.gnu.org/licenses/lgpl.html>, for more details.")
|
|||
(define-record/keywords <repl> language options tm-stats gc-stats)
|
||||
|
||||
(define repl-default-options
|
||||
'((trace . #f)
|
||||
'((compile-options . (#:warnings (unbound-variable arity-mismatch)))
|
||||
(trace . #f)
|
||||
(interp . #f)))
|
||||
|
||||
(define %make-repl make-repl)
|
||||
|
@ -132,13 +133,14 @@ See <http://www.gnu.org/licenses/lgpl.html>, for more details.")
|
|||
((language-reader (repl-language repl)) (current-input-port)
|
||||
(current-module)))
|
||||
|
||||
(define (repl-compile repl form . opts)
|
||||
(let ((to (lookup-language (cond ((memq #:e opts) 'scheme)
|
||||
((memq #:t opts) 'ghil)
|
||||
((memq #:c opts) 'glil)
|
||||
(else 'objcode))))
|
||||
(from (repl-language repl)))
|
||||
(compile form #:from from #:to to #:opts opts #:env (current-module))))
|
||||
(define (repl-compile-options repl)
|
||||
(repl-option-ref repl 'compile-options))
|
||||
|
||||
(define (repl-compile repl form)
|
||||
(let ((from (repl-language repl))
|
||||
(opts (repl-compile-options repl)))
|
||||
(compile form #:from from #:to 'objcode #:opts opts
|
||||
#:env (current-module))))
|
||||
|
||||
(define (repl-parse repl form)
|
||||
(let ((parser (language-parser (repl-language repl))))
|
||||
|
@ -150,7 +152,7 @@ See <http://www.gnu.org/licenses/lgpl.html>, for more details.")
|
|||
(or (null? (language-compilers (repl-language repl)))
|
||||
(assq-ref (repl-options repl) 'interp)))
|
||||
(lambda () (eval form (current-module)))
|
||||
(make-program (repl-compile repl form '())))))
|
||||
(make-program (repl-compile repl form)))))
|
||||
(% (thunk))))
|
||||
|
||||
(define (repl-print repl val)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue