X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=clnl;a=blobdiff_plain;f=src%2Fmain%2Fmain.lisp;h=8304d0f1432f2c85324dac1e02052fc4b8aad153;hp=594e787147611254c982686eeaa7d83389a3d0c9;hb=471de83db1aee70065808cbc061867e3320bf4b7;hpb=9621a2a05ca412a91fae1df8e43715f7579cd34c diff --git a/src/main/main.lisp b/src/main/main.lisp index 594e787..8304d0f 100644 --- a/src/main/main.lisp +++ b/src/main/main.lisp @@ -4,17 +4,21 @@ (defun r (str) (let* - ((lexed-ast (let ((ast (clnl-lexer:lex str))) (format t "Via lexing, AST for~%~S~% became~%~S~%~%" str ast) ast)) - (parsed-ast (let ((ast (clnl-parser:parse lexed-ast))) (format t "Via parsing, AST for~%~S~% became~%~S~%~%" lexed-ast ast) ast)) - (transpiled-ast (let ((ast (clnl-transpiler:transpile-commands parsed-ast))) (format t "Via transpiling, AST for~%~S~% became~%~S~%" parsed-ast ast) ast))) + ((lexed-ast (let ((ast (clnl-lexer:lex str))) + (format t "Via lexing, AST for~%~S~% became~%~S~%~%" str ast) ast)) + (parsed-ast (let ((ast (clnl-parser:parse lexed-ast))) + (format t "Via parsing, AST for~%~S~% became~%~S~%~%" lexed-ast ast) ast)) + (transpiled-ast (let ((ast (clnl-transpiler:transpile-commands parsed-ast))) + (format t "Via transpiling, AST for~%~S~% became~%~S~%" parsed-ast ast) ast))) (eval transpiled-ast))) (defun p (result) result) (defun run () - (loop for str = (progn (format t "> ") (force-output) (read-line)) - while str - do (p (e (r str)))) + (loop + :for str := (progn (format t "> ") (force-output) (read-line)) + :while str + :do (p (e (r str)))) (sb-ext:exit)) (defun boot () @@ -22,7 +26,7 @@ (clnl-nvm:create-world)) (defun run-commands (cmds) - (eval (clnl-transpiler:transpile-commands (clnl-parser:parse (clnl-lexer:lex cmds))))) + (eval (clnl-transpiler:transpile-commands (clnl-parser:parse (clnl-lexer:lex cmds))))) (defun run-reporter (reporter) (eval (clnl-transpiler:transpile-reporter (car (clnl-parser:parse (clnl-lexer:lex reporter))))))