Changeset 552
- Timestamp:
- 06/19/08 10:37:38 (5 months ago)
- Files:
-
- trunk/pcc/compiler/Makefile (modified) (3 diffs)
- trunk/pcc/compiler/commandline.scm (modified) (4 diffs)
- trunk/pcc/compiler/pdb.scm (modified) (1 diff)
- trunk/pcc/compiler/target.scm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/pcc/compiler/Makefile
r468 r552 2 2 include $(PCC_ROOT)/bigloo-rules.mk 3 3 4 BCOMMONFLAGS = -L ../libs -I ../libs4 BCOMMONFLAGS = $(READLINE_SRFI) -L ../libs -I ../libs 5 5 CCOMMONFLAGS = -I. -I$(BGL_DEFAULT_LIB_DIR) 6 6 … … 53 53 54 54 pcc_$(SU): $(PHPEVAL_LIBS) $(C_POPULATION) commandline_$(SU).o 55 bigloo $(SAFETY) $(PCC_LINK_OPTIONS) $(BCOMMONFLAGS) -o pcc_$(SU) commandline_$(SU).o -library php-runtime -library profiler -library webconnect -library phpeval 55 bigloo $(SAFETY) $(PCC_LINK_OPTIONS) $(BCOMMONFLAGS) -o pcc_$(SU) commandline_$(SU).o -library php-runtime -library profiler -library webconnect -library phpeval $(READLINE_BL_LIB) 56 56 57 57 pcc: pcc_$(SU) … … 116 116 cp pdb_$(SU) pdb 117 117 118 # we have to override these to add in READLINE_BL_LIB if it's available, since we can't do it119 # conditionally in the module clause120 pdb_s.o: pdb.scm121 $(BIGLOO) $(BSAFEFLAGS) $(READLINE_BL_LIB) $(READLINE_SRFI) $(BIGLOO_PIC) -c pdb.scm -o pdb_s.o122 pdb_u.o: pdb.scm123 $(BIGLOO) $(BUNSAFEFLAGS) $(READLINE_BL_LIB) $(READLINE_SRFI) $(BIGLOO_PIC) -c pdb.scm -o pdb_u.otrunk/pcc/compiler/commandline.scm
r518 r552 23 23 (include "php-runtime.sch") 24 24 (library profiler) 25 (cond-expand 26 (HAVE_LIBREADLINE (library pcc-rl))) 25 27 (import (driver "driver.scm") 26 28 (declare "declare.scm") … … 137 139 (if (maybe-add-script-argv "-a") 138 140 (begin 141 (cond-expand (HAVE_LIBREADLINE (history-init))) 142 (add-target-option! pcc-prompt-display: pcc-prompt-display) 143 (add-target-option! pcc-readline: pcc-readline) 139 144 (widen!::php-repl-target *current-target*)))) 140 145 … … 497 502 (exit 1))))) 498 503 504 ; used in interactive mode 505 (define (pcc-prompt-display) 506 (cond-expand (HAVE_LIBREADLINE #f) 507 (else 508 (display "\npcc > ")))) 509 510 (define (pcc-readline) 511 (let ((cmd (cond-expand (HAVE_LIBREADLINE 512 (readline "pcc > ")) 513 (else 514 (read-line))))) 515 (cond-expand (HAVE_LIBREADLINE 516 (when (string? cmd) 517 (history-add cmd)))) 518 cmd)) 519 ; 499 520 500 521 (define (usage-header) … … 503 524 "Usage: pcc [options] <input-files> [-- script args]" 504 525 "see pcc -h for help with command line options")) 505 506 526 507 527 trunk/pcc/compiler/pdb.scm
r531 r552 22 22 (module pcc-debugger 23 23 (library php-runtime) 24 (cond-expand 25 (HAVE_LIBREADLINE (library pcc-rl))) 24 26 (include "php-runtime.sch") 25 27 (library profiler) trunk/pcc/compiler/target.scm
r551 r552 140 140 (define-method (build-target target::php-repl-target) 141 141 (with-access::php-repl-target target (options) 142 (fluid-let ((*dynamic-load-path* (append (or (target-option library-paths:) '()) 142 (let ((pcc-prompt-display (car (target-option pcc-prompt-display:))) 143 (pcc-readline (car (target-option pcc-readline:)))) 144 (fluid-let ((*dynamic-load-path* (append (or (target-option library-paths:) '()) 143 145 *dynamic-load-path*))) 144 (setup-library-paths)145 (load-runtime-libs (or (target-option default-libs:) '()))146 (load-runtime-libs (or (target-option commandline-libs:) '()))147 (init-php-argv (if (target-option script-argv:)148 (reverse (target-option script-argv:))149 '()))150 (run-startup-functions)151 (set! *PHP-FILE* "Interactive shell")152 (set! *PHP-LINE* 0)153 (print "Interactive shell")154 (let loop ()155 (display* "pcc > ")156 (let ((input (read-line)))157 (unless (or (eof-object? input)158 (string=? input "quit")159 (string=? input "exit"))160 (try161 (begin162 (php-repl-eval input)163 (print))164 (lambda (e p m o)165 (print m)166 (e #f)))167 (loop))))168 (print))))146 (setup-library-paths) 147 (load-runtime-libs (or (target-option default-libs:) '())) 148 (load-runtime-libs (or (target-option commandline-libs:) '())) 149 (init-php-argv (if (target-option script-argv:) 150 (reverse (target-option script-argv:)) 151 '())) 152 (run-startup-functions) 153 (set! *PHP-FILE* "Interactive shell") 154 (set! *PHP-LINE* 0) 155 (print "Interactive shell") 156 (let loop () 157 (pcc-prompt-display) 158 (let ((input (pcc-readline))) 159 (unless (or (eof-object? input) 160 (string=? input "quit") 161 (string=? input "exit")) 162 (try 163 (begin 164 (php-repl-eval input) 165 (print)) 166 (lambda (e p m o) 167 (print m) 168 (e #f))) 169 (loop)))) 170 (print))))) 169 171 170 172 (define-method (build-target target::scheme-repl-target)
