From b52e5b548ad1b9143818891d5642cf9470a41b53 Mon Sep 17 00:00:00 2001 From: mRnea Date: Wed, 14 Aug 2024 00:42:24 +0300 Subject: added a simple test for macros, also more cli stuff --- main.lisp | 17 +++++++++-------- test/makro.lorth | 6 ++++++ 2 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 test/makro.lorth diff --git a/main.lisp b/main.lisp index a43f798..15b33a7 100644 --- a/main.lisp +++ b/main.lisp @@ -56,14 +56,22 @@ (finish)) (simulate-program (parse-tokens (lex-line line 0))))) +(defun comp-options () + (list (clingon:make-option + :filepath + :description "Kaynak dosyasını belirt." + :short-name #\k + :key :kaynak))) + (defun subcommands () (list (clingon:make-command :name "derle" :description "Dosyadaki programı derle" :usage "" + :options (comp-options) :handler (lambda (cmd) (generate-program (make-program - (car (clingon:command-arguments cmd))) + (clingon:getopt cmd :kaynak)) :compile t))) (clingon:make-command :name "test" @@ -122,13 +130,6 @@ ;; :short-name #\s ;; :key :simulate))) -;; (defun comp-options () -;; (list (clingon:make-option -;; :filepath -;; :description "Dosyadaki programı derle." -;; :short-name #\c -;; :key :compile))) - ;; (defun test-options () ;; (list (clingon:make-option ;; :flag diff --git a/test/makro.lorth b/test/makro.lorth new file mode 100644 index 0000000..405f98b --- /dev/null +++ b/test/makro.lorth @@ -0,0 +1,6 @@ +;;; test +;;; (format nil "Hello world!..~%") +makro write değiş 1 syscall-3 son +makro stdout 1 son + +stdout "Hello world!..\n" write -- cgit v1.2.3