mirror of
https://github.com/false-schemers/skint.git
synced 2024-12-25 21:58:54 +01:00
~! in format, prompt flush, ,load repl cmd
This commit is contained in:
parent
a2da6a23e8
commit
781fa509e2
4 changed files with 135 additions and 144 deletions
34
s.c
34
s.c
|
@ -1,4 +1,4 @@
|
|||
/* s.c -- partially generated via skint -c s.scm */
|
||||
/* s.c -- generated via skint -c s.scm */
|
||||
#include "s.h"
|
||||
#include "n.h"
|
||||
|
||||
|
@ -17,7 +17,6 @@ int dirsep = '\\';
|
|||
int dirsep = '/';
|
||||
#endif
|
||||
|
||||
|
||||
char *s_code[] = {
|
||||
|
||||
"S", "let-syntax",
|
||||
|
@ -1028,9 +1027,9 @@ char *s_code[] = {
|
|||
"${@(y7:newline),@(y14:make-parameter)[01}@!(y17:format-fresh-line)",
|
||||
|
||||
"C", 0,
|
||||
"${'(s78:supported directives: ~~ ~%25 ~%25 ~& ~t ~_ ~a ~s ~w ~y ~c ~b "
|
||||
"~o ~d ~x ~f ~? ~k ~*),@(y14:make-parameter)[01}@!(y18:format-help-stri"
|
||||
"ng)",
|
||||
"${'(s78:supported directives: ~~ ~%25 ~& ~t ~_ ~a ~s ~w ~y ~c ~b ~o ~d"
|
||||
" ~x ~f ~? ~k ~* ~!),@(y14:make-parameter)[01}@!(y18:format-help-string"
|
||||
")",
|
||||
|
||||
"P", "fprintf",
|
||||
"%!2,,,,#0#1#2#3&0{%1.0p?{.0a]1}'(s35:format: no argument for ~ directi"
|
||||
|
@ -1044,18 +1043,19 @@ char *s_code[] = {
|
|||
".2d,:4^[62}'(c~),.1v?{:3,'(c~)W0.5,.2d,:4^[62}'(c%25),.1v?{:3W6.5,.2d,"
|
||||
":4^[62}'(ct),.1v?{:3,'(c%09)W0.5,.2d,:4^[62}'(c_),.1v?{:3,'(c )W0.5,.2"
|
||||
"d,:4^[62}'(c&),.1v?{${:3,${@(y17:format-fresh-line)[00}[01}.5,.2d,:4^["
|
||||
"62}'(cs),.1v?{:3,${.8,:1^[01}W5.5d,.2d,:4^[62}'(ca),.1v?{:3,${.8,:1^[0"
|
||||
"1}W4.5d,.2d,:4^[62}'(cw),.1v?{:3,${.8,:1^[01}W7.5d,.2d,:4^[62}'(cc),.1"
|
||||
"v?{:3,${.8,:1^[01}W0.5d,.2d,:4^[62}'(cb),.1v?{${:3,${.(i10),:1^[01},'2"
|
||||
",:0^[03}.5d,.2d,:4^[62}'(co),.1v?{${:3,${.(i10),:1^[01},'8,:0^[03}.5d,"
|
||||
".2d,:4^[62}'(cd),.1v?{${:3,${.(i10),:1^[01},'(i10),:0^[03}.5d,.2d,:4^["
|
||||
"62}'(cx),.1v?{${:3,${.(i10),:1^[01},'(i16),:0^[03}.5d,.2d,:4^[62}'(ch)"
|
||||
",.1v?{:3,${@(y18:format-help-string)[00}W4.5,.2d,:4^[62}'(cy),.1v?{${:"
|
||||
"3,${.(i10),:1^[01},${@(y19:format-pretty-print)[00}[02}.5d,.2d,:4^[62}"
|
||||
"'(cf),.1v?{${:3,.5^,.7^,${.(i12),:1^[01},${@(y18:format-fixed-print)[0"
|
||||
"0}[04}.5d,.2d,:4^[62}'(l2:c?;ck;),.1A1?{${${${.(i11),:1^[01},:1^[01},$"
|
||||
"{.(i10),:1^[01}X2,:4^[02}.5dd,.2d,:4^[62}.1a,'(s32:format: unrecognize"
|
||||
"d ~ directive),@(y5:error)[62}:3,.1aW0.1,.1d,:4^[22}.!0.0^_1[72",
|
||||
"62}'(c!),.1v?{:3P71.5,.2d,:4^[62}'(cs),.1v?{:3,${.8,:1^[01}W5.5d,.2d,:"
|
||||
"4^[62}'(ca),.1v?{:3,${.8,:1^[01}W4.5d,.2d,:4^[62}'(cw),.1v?{:3,${.8,:1"
|
||||
"^[01}W7.5d,.2d,:4^[62}'(cc),.1v?{:3,${.8,:1^[01}W0.5d,.2d,:4^[62}'(cb)"
|
||||
",.1v?{${:3,${.(i10),:1^[01},'2,:0^[03}.5d,.2d,:4^[62}'(co),.1v?{${:3,$"
|
||||
"{.(i10),:1^[01},'8,:0^[03}.5d,.2d,:4^[62}'(cd),.1v?{${:3,${.(i10),:1^["
|
||||
"01},'(i10),:0^[03}.5d,.2d,:4^[62}'(cx),.1v?{${:3,${.(i10),:1^[01},'(i1"
|
||||
"6),:0^[03}.5d,.2d,:4^[62}'(ch),.1v?{:3,${@(y18:format-help-string)[00}"
|
||||
"W4.5,.2d,:4^[62}'(cy),.1v?{${:3,${.(i10),:1^[01},${@(y19:format-pretty"
|
||||
"-print)[00}[02}.5d,.2d,:4^[62}'(cf),.1v?{${:3,.5^,.7^,${.(i12),:1^[01}"
|
||||
",${@(y18:format-fixed-print)[00}[04}.5d,.2d,:4^[62}'(l2:c?;ck;),.1A1?{"
|
||||
"${${${.(i11),:1^[01},:1^[01},${.(i10),:1^[01}X2,:4^[02}.5dd,.2d,:4^[62"
|
||||
"}.1a,'(s32:format: unrecognized ~ directive),@(y5:error)[62}:3,.1aW0.1"
|
||||
",.1d,:4^[22}.!0.0^_1[72",
|
||||
|
||||
"P", "format",
|
||||
"%!1f,.2q,.0?{.0}{.2S0}_1?{P51,.2?{.1,.3c}{.1},${.2,.4c,@(y7:fprintf),@"
|
||||
|
|
|
@ -1964,7 +1964,7 @@
|
|||
(define format-fresh-line ; TODO: add (fresh-line [p]) instruction for source ports
|
||||
(make-parameter newline))
|
||||
(define format-help-string
|
||||
(make-parameter "supported directives: ~~ ~% ~% ~& ~t ~_ ~a ~s ~w ~y ~c ~b ~o ~d ~x ~f ~? ~k ~*"))
|
||||
(make-parameter "supported directives: ~~ ~% ~& ~t ~_ ~a ~s ~w ~y ~c ~b ~o ~d ~x ~f ~? ~k ~* ~!"))
|
||||
|
||||
(define (fprintf p fs . args)
|
||||
(define (hd args)
|
||||
|
@ -1988,12 +1988,13 @@
|
|||
(when (null? (cdr fl)) (error "format: incomplete escape sequence"))
|
||||
(let* ([w -1] [d -1] [fl (memd (cdr fl) (set& w) (set& d))])
|
||||
(case (char-downcase (car fl))
|
||||
[(#\*) (lp (cdr fl) (cddr args))] ;+ CL
|
||||
[(#\*) (lp (cdr fl) (cddr args))] ;+ CL, skips 1 arg
|
||||
[(#\~) (write-char #\~ p) (lp (cdr fl) args)]
|
||||
[(#\%) (newline p) (lp (cdr fl) args)]
|
||||
[(#\t) (write-char #\tab p) (lp (cdr fl) args)]
|
||||
[(#\_) (write-char #\space p) (lp (cdr fl) args)]
|
||||
[(#\&) ((format-fresh-line) p) (lp (cdr fl) args)]
|
||||
[(#\!) (flush-output-port p) (lp (cdr fl) args)] ;+ common
|
||||
[(#\s) (write (hd args) p) (lp (cdr fl) (cdr args))]
|
||||
[(#\a) (display (hd args) p) (lp (cdr fl) (cdr args))]
|
||||
[(#\w) (write-shared (hd args) p) (lp (cdr fl) (cdr args))]
|
||||
|
|
123
src/t.scm
123
src/t.scm
|
@ -2244,76 +2244,69 @@
|
|||
(for-each print vals)))
|
||||
|
||||
(define (repl-read ip prompt op)
|
||||
(when prompt (newline op) (display prompt op) (display " " op))
|
||||
(when prompt (format op "~%~a ~!" prompt))
|
||||
(read-code-sexp ip))
|
||||
|
||||
(define (repl-exec-command cmd argstr op)
|
||||
(define args
|
||||
(if (memq cmd '(peek sh)) ; do not expect s-exps!
|
||||
(if (memq cmd '(load sh)) ; do not expect s-exps!
|
||||
(list (string-trim-whitespace argstr))
|
||||
(guard (err [else (void)]) (read-port-sexps (open-input-string argstr)))))
|
||||
(define cmd+args (cons cmd args))
|
||||
(sexp-case cmd+args
|
||||
[(say hello) (display "Well, hello!\n" op)]
|
||||
[(ref <symbol>) (write (repl-environment (car args) 'ref) op) (newline op)]
|
||||
[(ref (* * ...)) (write (repl-environment (car args) 'ref) op) (newline op)]
|
||||
[(rnr) (write *root-name-registry* op) (newline op)]
|
||||
[(rref *) (write (name-lookup *root-name-registry* (car args) #f) op) (newline op)]
|
||||
[(rrem! *) (cond [(name-lookup *root-name-registry* (car args) #f)
|
||||
(name-remove! *root-name-registry* (car args)) (display "done!\n" op)]
|
||||
[else (display "name not found: " op) (write name op) (newline op)])]
|
||||
[(unr) (write *user-name-registry* op) (newline op)]
|
||||
[(uref *) (write (name-lookup *user-name-registry* (car args) #f) op) (newline op)]
|
||||
[(urem! *) (cond [(name-lookup *user-name-registry* (car args) #f)
|
||||
(name-remove! *user-name-registry* (car args)) (display "done!\n" op)]
|
||||
[else (display "name not found: " op) (write name op) (newline op)])]
|
||||
[(gs) (write (global-store) op) (newline op)]
|
||||
[(gs <symbol>) (let* ([k (car args)] [v (global-store)] [i (immediate-hash k (vector-length v))])
|
||||
(write (cond [(assq k (vector-ref v i)) => cdr] [else #f]) op) (newline op))]
|
||||
[(peek *)
|
||||
(cond [(string? (car args))
|
||||
(display (if (file-exists? (car args))
|
||||
"file exists\n" "file does not exist\n") op)]
|
||||
[(symbol? (car args))
|
||||
(display (if (file-exists? (symbol->string (car args)))
|
||||
"file exists\n" "file does not exist\n") op)]
|
||||
[else (display "invalid file name; use double quotes\n" op)])]
|
||||
[(v) (set! *verbose* #t)]
|
||||
[(verbose on) (set! *verbose* #t)]
|
||||
[(verbose off) (set! *verbose* #f)]
|
||||
[(q) (set! *quiet* #t)]
|
||||
[(quiet on) (set! *quiet* #t)]
|
||||
[(quiet off) (set! *quiet* #f)]
|
||||
[(time *) (let ([start (current-jiffy)])
|
||||
(repl-evaluate-top-form (car args) repl-environment op)
|
||||
(format #t "; elapsed time: ~s ms.~%"
|
||||
(* 1000 (/ (- (current-jiffy) start) (jiffies-per-second)))))]
|
||||
[(sh <string>) (%system (car args))]
|
||||
[(help)
|
||||
(display "Available commands:\n" op)
|
||||
(display " ,say hello -- displays nice greeting\n" op)
|
||||
(display " ,peek <fname> -- check if file exists\n" op)
|
||||
(display " ,q -- disable informational messages\n" op)
|
||||
(display " ,quiet on -- disable informational messages\n" op)
|
||||
(display " ,quiet off -- enable informational messages\n" op)
|
||||
(display " ,v -- turn verbosity on\n" op)
|
||||
(display " ,verbose on -- turn verbosity on\n" op)
|
||||
(display " ,verbose off -- turn verbosity off\n" op)
|
||||
(display " ,ref <name> -- show denotation for <name> (may alloc)\n" op)
|
||||
(display " ,rnr -- show root name registry\n" op)
|
||||
(display " ,rref <name> -- lookup name in root registry\n" op)
|
||||
(display " ,rrem! <name> -- remove name from root registry\n" op)
|
||||
(display " ,unr -- show user name registry\n" op)
|
||||
(display " ,uref <name> -- lookup name in user registry\n" op)
|
||||
(display " ,urem! <name> -- remove name from user registry\n" op)
|
||||
(display " ,gs -- show global store (big!)\n" op)
|
||||
(display " ,gs <name> -- lookup global location for <name>\n" op)
|
||||
(display " ,time <expr> -- time short expression <expr>\n" op)
|
||||
(display " ,sh <cmdline> -- send <cmdline> to local shell\n" op)
|
||||
(display " ,help -- this help\n" op)]
|
||||
[else
|
||||
(display "syntax error in repl command\n" op)
|
||||
(display "type ,help to see available commands\n" op)]))
|
||||
(let retry ([cmd+args (cons cmd args)])
|
||||
(sexp-case cmd+args
|
||||
[(ref <symbol>) (write (repl-environment (car args) 'ref) op) (newline op)]
|
||||
[(ref (* * ...)) (write (repl-environment (car args) 'ref) op) (newline op)]
|
||||
[(rnr) (write *root-name-registry* op) (newline op)]
|
||||
[(rref *) (write (name-lookup *root-name-registry* (car args) #f) op) (newline op)]
|
||||
[(rrem! *) (cond [(name-lookup *root-name-registry* (car args) #f)
|
||||
(name-remove! *root-name-registry* (car args)) (display "done!\n" op)]
|
||||
[else (display "name not found: " op) (write name op) (newline op)])]
|
||||
[(unr) (write *user-name-registry* op) (newline op)]
|
||||
[(uref *) (write (name-lookup *user-name-registry* (car args) #f) op) (newline op)]
|
||||
[(urem! *) (cond [(name-lookup *user-name-registry* (car args) #f)
|
||||
(name-remove! *user-name-registry* (car args)) (display "done!\n" op)]
|
||||
[else (display "name not found: " op) (write name op) (newline op)])]
|
||||
[(gs) (write (global-store) op) (newline op)]
|
||||
[(gs <symbol>)
|
||||
(let* ([k (car args)] [v (global-store)] [i (immediate-hash k (vector-length v))])
|
||||
(write (cond [(assq k (vector-ref v i)) => cdr] [else #f]) op) (newline op))]
|
||||
[(load <string>) (load (car args))]
|
||||
[(verbose on) (set! *verbose* #t)]
|
||||
[(verbose off) (set! *verbose* #f)]
|
||||
[(v) (set! *verbose* #t)]
|
||||
[(quiet on) (set! *quiet* #t)]
|
||||
[(quiet off) (set! *quiet* #f)]
|
||||
[(q) (set! *quiet* #t)]
|
||||
[(time *) (let ([start (current-jiffy)])
|
||||
(repl-evaluate-top-form (car args) repl-environment op)
|
||||
(format #t "; elapsed time: ~s ms.~%"
|
||||
(* 1000 (/ (- (current-jiffy) start) (jiffies-per-second)))))]
|
||||
[(sh <string>) (%system (car args))]
|
||||
[(help)
|
||||
(display "\nAvailable commands:\n" op)
|
||||
(display " ,load <fname> -- loads <fname> (no quotes needed)\n" op)
|
||||
(display " ,q -- disable informational messages\n" op)
|
||||
(display " ,quiet on -- disable informational messages\n" op)
|
||||
(display " ,quiet off -- enable informational messages\n" op)
|
||||
(display " ,v -- turn verbosity on\n" op)
|
||||
(display " ,verbose on -- turn verbosity on\n" op)
|
||||
(display " ,verbose off -- turn verbosity off\n" op)
|
||||
(display " ,ref <name> -- show denotation for <name> (may alloc)\n" op)
|
||||
(display " ,rnr -- show root name registry\n" op)
|
||||
(display " ,rref <name> -- lookup name in root registry\n" op)
|
||||
(display " ,rrem! <name> -- remove name from root registry\n" op)
|
||||
(display " ,unr -- show user name registry\n" op)
|
||||
(display " ,uref <name> -- lookup name in user registry\n" op)
|
||||
(display " ,urem! <name> -- remove name from user registry\n" op)
|
||||
(display " ,gs -- show global store (big!)\n" op)
|
||||
(display " ,gs <name> -- lookup global location for <name>\n" op)
|
||||
(display " ,time <expr> -- time short expression <expr>\n" op)
|
||||
(display " ,sh <cmdline> -- send <cmdline> to local shell\n" op)
|
||||
(display " ,help -- this help\n" op)]
|
||||
[(h) (retry '(help))]
|
||||
[else
|
||||
(display "syntax error in repl command\n" op)
|
||||
(display "type ,help to see available commands\n" op)])))
|
||||
|
||||
(define (repl-from-port ip env prompt op)
|
||||
(define cfs (current-file-stack))
|
||||
|
@ -2354,7 +2347,7 @@
|
|||
(when (and (tty-port? (current-input-port)) (tty-port? (current-output-port)))
|
||||
; quick check for non-interactive use failed, greet
|
||||
(display "SKINT Scheme Interpreter v0.0.9\n")
|
||||
(display "Copyright (c) 2024 False Schemers\n\n"))
|
||||
(display "Copyright (c) 2024 False Schemers\n"))
|
||||
#t) ; exited normally
|
||||
|
||||
(define (repl)
|
||||
|
|
117
t.c
117
t.c
|
@ -1398,67 +1398,64 @@ char *t_code[] = {
|
|||
"list1?)[01}?{.0^aY8}{f}~?{.0^,.2^,@(y10:%25for-each1)[52}]5",
|
||||
|
||||
"P", "repl-read",
|
||||
"%3.1?{.2W6.2,.2W4.2,'(s1: )W4}.0,@(y14:read-code-sexp)[31",
|
||||
"%3.1?{${.3,'(s7:~%25~a ~!),.6,@(y6:format)[03}}.0,@(y14:read-code-sexp"
|
||||
")[31",
|
||||
|
||||
"P", "repl-exec-command",
|
||||
"%3,,#0#1'(l2:y4:peek;y2:sh;),.3A0?{${.5,@(y22:string-trim-whitespace)["
|
||||
"01},l1}{${${k0,.0,${.2,.(i12),&2{%0:1,&1{%!0.0,&1{%0:0,@(y6:values),@("
|
||||
"y13:apply-to-list)[02},:0[11},:0,&1{%0:0P50,@(y15:read-port-sexps)[01}"
|
||||
",@(y16:call-with-values)[02},.3,&1{%1${k0,.0,${.6,&1{%0:0,Y9]1},:0[01}"
|
||||
"_1_3}[10},@(y22:with-exception-handler)[02}_1_3}[00}}.!0.0^,.3c.!1${.3"
|
||||
"^,'(l2:y3:say;y5:hello;),@(y11:sexp-match?)[02}?{.4,'(s13:Well, hello!"
|
||||
"%0a)W4]5}${.3^,'(l2:y3:ref;y8:<symbol>;),@(y11:sexp-match?)[02}?{.4,${"
|
||||
"'(y3:ref),.4^a,@(y16:repl-environment)[02}W5.4W6]5}${.3^,'(l2:y3:ref;l"
|
||||
"3:y1:*;y1:*;y3:...;;),@(y11:sexp-match?)[02}?{.4,${'(y3:ref),.4^a,@(y1"
|
||||
"6:repl-environment)[02}W5.4W6]5}${.3^,'(l1:y3:rnr;),@(y11:sexp-match?)"
|
||||
"[02}?{.4,@(y20:*root-name-registry*)W5.4W6]5}${.3^,'(l2:y4:rref;y1:*;)"
|
||||
",@(y11:sexp-match?)[02}?{.4,${f,.4^a,@(y20:*root-name-registry*),@(y11"
|
||||
":name-lookup)[03}W5.4W6]5}${.3^,'(l2:y5:rrem!;y1:*;),@(y11:sexp-match?"
|
||||
")[02}?{${f,.3^a,@(y20:*root-name-registry*),@(y11:name-lookup)[03}?{${"
|
||||
".2^a,@(y20:*root-name-registry*),@(y12:name-remove!)[02}.4,'(s6:done!%"
|
||||
"0a)W4]5}.4,'(s16:name not found: )W4.4,@(y4:name)W5.4W6]5}${.3^,'(l1:y"
|
||||
"3:unr;),@(y11:sexp-match?)[02}?{.4,@(y20:*user-name-registry*)W5.4W6]5"
|
||||
"}${.3^,'(l2:y4:uref;y1:*;),@(y11:sexp-match?)[02}?{.4,${f,.4^a,@(y20:*"
|
||||
"user-name-registry*),@(y11:name-lookup)[03}W5.4W6]5}${.3^,'(l2:y5:urem"
|
||||
"!;y1:*;),@(y11:sexp-match?)[02}?{${f,.3^a,@(y20:*user-name-registry*),"
|
||||
"@(y11:name-lookup)[03}?{${.2^a,@(y20:*user-name-registry*),@(y12:name-"
|
||||
"remove!)[02}.4,'(s6:done!%0a)W4]5}.4,'(s16:name not found: )W4.4,@(y4:"
|
||||
"name)W5.4W6]5}${.3^,'(l1:y2:gs;),@(y11:sexp-match?)[02}?{.4,U2W5.4W6]5"
|
||||
"}${.3^,'(l2:y2:gs;y8:<symbol>;),@(y11:sexp-match?)[02}?{.0^a,U2,.0V3,."
|
||||
"2H2,.7,.1,.3V4,.4A3,.0?{.0d}{f}_1W5.7W6]8}${.3^,'(l2:y4:peek;y1:*;),@("
|
||||
"y11:sexp-match?)[02}?{.0^aS0?{.4,.1^aF0?{'(s12:file exists%0a)}{'(s20:"
|
||||
"file does not exist%0a)}W4]5}.0^aY0?{.4,.1^aX4F0?{'(s12:file exists%0a"
|
||||
")}{'(s20:file does not exist%0a)}W4]5}.4,'(s37:invalid file name; use "
|
||||
"double quotes%0a)W4]5}${.3^,'(l1:y1:v;),@(y11:sexp-match?)[02}?{t@!(y9"
|
||||
":*verbose*)]5}${.3^,'(l2:y7:verbose;y2:on;),@(y11:sexp-match?)[02}?{t@"
|
||||
"!(y9:*verbose*)]5}${.3^,'(l2:y7:verbose;y3:off;),@(y11:sexp-match?)[02"
|
||||
"}?{f@!(y9:*verbose*)]5}${.3^,'(l1:y1:q;),@(y11:sexp-match?)[02}?{t@!(y"
|
||||
"7:*quiet*)]5}${.3^,'(l2:y5:quiet;y2:on;),@(y11:sexp-match?)[02}?{t@!(y"
|
||||
"7:*quiet*)]5}${.3^,'(l2:y5:quiet;y3:off;),@(y11:sexp-match?)[02}?{f@!("
|
||||
"y7:*quiet*)]5}${.3^,'(l2:y4:time;y1:*;),@(y11:sexp-match?)[02}?{Z3,${."
|
||||
"7,@(y16:repl-environment),.5^a,@(y22:repl-evaluate-top-form)[03}Z4,.1,"
|
||||
"Z3-/,'(i1000)*,'(s24:; elapsed time: ~s ms.~%25),t,@(y6:format)[63}${."
|
||||
"3^,'(l2:y2:sh;y8:<string>;),@(y11:sexp-match?)[02}?{.0^aZ6]5}${.3^,'(l"
|
||||
"1:y4:help;),@(y11:sexp-match?)[02}?{.4,'(s20:Available commands:%0a)W4"
|
||||
".4,'(s42: ,say hello -- displays nice greeting%0a)W4.4,'(s40: ,pee"
|
||||
"k <fname> -- check if file exists%0a)W4.4,'(s50: ,q -- di"
|
||||
"sable informational messages%0a)W4.4,'(s50: ,quiet on -- disable "
|
||||
"informational messages%0a)W4.4,'(s49: ,quiet off -- enable informa"
|
||||
"tional messages%0a)W4.4,'(s37: ,v -- turn verbosity on%0a)"
|
||||
"W4.4,'(s37: ,verbose on -- turn verbosity on%0a)W4.4,'(s38: ,verbos"
|
||||
"e off -- turn verbosity off%0a)W4.4,'(s58: ,ref <name> -- show de"
|
||||
"notation for <name> (may alloc)%0a)W4.4,'(s43: ,rnr -- show "
|
||||
"root name registry%0a)W4.4,'(s48: ,rref <name> -- lookup name in roo"
|
||||
"t registry%0a)W4.4,'(s50: ,rrem! <name> -- remove name from root regi"
|
||||
"stry%0a)W4.4,'(s43: ,unr -- show user name registry%0a)W4.4,"
|
||||
"'(s48: ,uref <name> -- lookup name in user registry%0a)W4.4,'(s50: ,"
|
||||
"urem! <name> -- remove name from user registry%0a)W4.4,'(s44: ,gs "
|
||||
" -- show global store (big!)%0a)W4.4,'(s53: ,gs <name> -- l"
|
||||
"ookup global location for <name>%0a)W4.4,'(s48: ,time <expr> -- time"
|
||||
" short expression <expr>%0a)W4.4,'(s49: ,sh <cmdline> -- send <cmdlin"
|
||||
"e> to local shell%0a)W4.4,'(s29: ,help -- this help%0a)W4]5}."
|
||||
"4,'(s29:syntax error in repl command%0a)W4.4,'(s37:type ,help to see a"
|
||||
"vailable commands%0a)W4]5",
|
||||
"%3,#0'(l2:y4:load;y2:sh;),.2A0?{${.4,@(y22:string-trim-whitespace)[01}"
|
||||
",l1}{${${k0,.0,${.2,.(i11),&2{%0:1,&1{%!0.0,&1{%0:0,@(y6:values),@(y13"
|
||||
":apply-to-list)[02},:0[11},:0,&1{%0:0P50,@(y15:read-port-sexps)[01},@("
|
||||
"y16:call-with-values)[02},.3,&1{%1${k0,.0,${.6,&1{%0:0,Y9]1},:0[01}_1_"
|
||||
"3}[10},@(y22:with-exception-handler)[02}_1_3}[00}}.!0.0^,.2c,,#0.5,.1,"
|
||||
".4,&3{%1${.2,'(l2:y3:ref;y8:<symbol>;),@(y11:sexp-match?)[02}?{:2,${'("
|
||||
"y3:ref),:0^a,@(y16:repl-environment)[02}W5:2W6]1}${.2,'(l2:y3:ref;l3:y"
|
||||
"1:*;y1:*;y3:...;;),@(y11:sexp-match?)[02}?{:2,${'(y3:ref),:0^a,@(y16:r"
|
||||
"epl-environment)[02}W5:2W6]1}${.2,'(l1:y3:rnr;),@(y11:sexp-match?)[02}"
|
||||
"?{:2,@(y20:*root-name-registry*)W5:2W6]1}${.2,'(l2:y4:rref;y1:*;),@(y1"
|
||||
"1:sexp-match?)[02}?{:2,${f,:0^a,@(y20:*root-name-registry*),@(y11:name"
|
||||
"-lookup)[03}W5:2W6]1}${.2,'(l2:y5:rrem!;y1:*;),@(y11:sexp-match?)[02}?"
|
||||
"{${f,:0^a,@(y20:*root-name-registry*),@(y11:name-lookup)[03}?{${:0^a,@"
|
||||
"(y20:*root-name-registry*),@(y12:name-remove!)[02}:2,'(s6:done!%0a)W4]"
|
||||
"1}:2,'(s16:name not found: )W4:2,@(y4:name)W5:2W6]1}${.2,'(l1:y3:unr;)"
|
||||
",@(y11:sexp-match?)[02}?{:2,@(y20:*user-name-registry*)W5:2W6]1}${.2,'"
|
||||
"(l2:y4:uref;y1:*;),@(y11:sexp-match?)[02}?{:2,${f,:0^a,@(y20:*user-nam"
|
||||
"e-registry*),@(y11:name-lookup)[03}W5:2W6]1}${.2,'(l2:y5:urem!;y1:*;),"
|
||||
"@(y11:sexp-match?)[02}?{${f,:0^a,@(y20:*user-name-registry*),@(y11:nam"
|
||||
"e-lookup)[03}?{${:0^a,@(y20:*user-name-registry*),@(y12:name-remove!)["
|
||||
"02}:2,'(s6:done!%0a)W4]1}:2,'(s16:name not found: )W4:2,@(y4:name)W5:2"
|
||||
"W6]1}${.2,'(l1:y2:gs;),@(y11:sexp-match?)[02}?{:2,U2W5:2W6]1}${.2,'(l2"
|
||||
":y2:gs;y8:<symbol>;),@(y11:sexp-match?)[02}?{:0^a,U2,.0V3,.2H2,:2,.1,."
|
||||
"3V4,.4A3,.0?{.0d}{f}_1W5:2W6]4}${.2,'(l2:y4:load;y8:<string>;),@(y11:s"
|
||||
"exp-match?)[02}?{:0^a,@(y4:load)[11}${.2,'(l2:y7:verbose;y2:on;),@(y11"
|
||||
":sexp-match?)[02}?{t@!(y9:*verbose*)]1}${.2,'(l2:y7:verbose;y3:off;),@"
|
||||
"(y11:sexp-match?)[02}?{f@!(y9:*verbose*)]1}${.2,'(l1:y1:v;),@(y11:sexp"
|
||||
"-match?)[02}?{t@!(y9:*verbose*)]1}${.2,'(l2:y5:quiet;y2:on;),@(y11:sex"
|
||||
"p-match?)[02}?{t@!(y7:*quiet*)]1}${.2,'(l2:y5:quiet;y3:off;),@(y11:sex"
|
||||
"p-match?)[02}?{f@!(y7:*quiet*)]1}${.2,'(l1:y1:q;),@(y11:sexp-match?)[0"
|
||||
"2}?{t@!(y7:*quiet*)]1}${.2,'(l2:y4:time;y1:*;),@(y11:sexp-match?)[02}?"
|
||||
"{Z3,${:2,@(y16:repl-environment),:0^a,@(y22:repl-evaluate-top-form)[03"
|
||||
"}Z4,.1,Z3-/,'(i1000)*,'(s24:; elapsed time: ~s ms.~%25),t,@(y6:format)"
|
||||
"[23}${.2,'(l2:y2:sh;y8:<string>;),@(y11:sexp-match?)[02}?{:0^aZ6]1}${."
|
||||
"2,'(l1:y4:help;),@(y11:sexp-match?)[02}?{:2,'(s21:%0aAvailable command"
|
||||
"s:%0a)W4:2,'(s52: ,load <fname> -- loads <fname> (no quotes needed)%0"
|
||||
"a)W4:2,'(s50: ,q -- disable informational messages%0a)W4:2"
|
||||
",'(s50: ,quiet on -- disable informational messages%0a)W4:2,'(s49"
|
||||
": ,quiet off -- enable informational messages%0a)W4:2,'(s37: ,v "
|
||||
" -- turn verbosity on%0a)W4:2,'(s37: ,verbose on -- turn v"
|
||||
"erbosity on%0a)W4:2,'(s38: ,verbose off -- turn verbosity off%0a)W4:"
|
||||
"2,'(s58: ,ref <name> -- show denotation for <name> (may alloc)%0a)W"
|
||||
"4:2,'(s43: ,rnr -- show root name registry%0a)W4:2,'(s48: ,r"
|
||||
"ref <name> -- lookup name in root registry%0a)W4:2,'(s50: ,rrem! <na"
|
||||
"me> -- remove name from root registry%0a)W4:2,'(s43: ,unr -"
|
||||
"- show user name registry%0a)W4:2,'(s48: ,uref <name> -- lookup name"
|
||||
" in user registry%0a)W4:2,'(s50: ,urem! <name> -- remove name from us"
|
||||
"er registry%0a)W4:2,'(s44: ,gs -- show global store (big!)%"
|
||||
"0a)W4:2,'(s53: ,gs <name> -- lookup global location for <name>%0a)"
|
||||
"W4:2,'(s48: ,time <expr> -- time short expression <expr>%0a)W4:2,'(s"
|
||||
"49: ,sh <cmdline> -- send <cmdline> to local shell%0a)W4:2,'(s29: ,he"
|
||||
"lp -- this help%0a)W4]1}${.2,'(l1:y1:h;),@(y11:sexp-match?)[0"
|
||||
"2}?{'(l1:y4:help;),:1^[11}:2,'(s29:syntax error in repl command%0a)W4:"
|
||||
"2,'(s37:type ,help to see available commands%0a)W4]1}.!0.0^_1[41",
|
||||
|
||||
"P", "repl-from-port",
|
||||
"%4,#0${@(y18:current-file-stack)[00}.!0${k0,.0,${.2,.9,.(i12),.(i12),."
|
||||
|
@ -1489,7 +1486,7 @@ char *t_code[] = {
|
|||
|
||||
"P", "repl-main",
|
||||
"%0PiP09?{PoP09}{f}?{Po,'(s32:SKINT Scheme Interpreter v0.0.9%0a)W4Po,'"
|
||||
"(s35:Copyright (c) 2024 False Schemers%0a%0a)W4}t]0",
|
||||
"(s34:Copyright (c) 2024 False Schemers%0a)W4}t]0",
|
||||
|
||||
"P", "repl",
|
||||
"%0,,,#0#1#2Pi.!0Po.!1.0^P09?{'(s6:skint])}{f}.!2${n,@(y23:set-current-"
|
||||
|
|
Loading…
Reference in a new issue