From 3e725aa6cba5125106fabd531357862790aa7a6f Mon Sep 17 00:00:00 2001 From: ketmar Date: Thu, 2 Nov 2023 07:51:42 +0000 Subject: [PATCH] urasm: cosmetix in expression compiler FossilOrigin-Name: 646b2ee5a3da32b9196e1be7950fc18917afc4477c8eafb0f568f1fdbd0028fa --- urflibs/urasm/expr.f | 37 +++++++------------------------------ 1 file changed, 7 insertions(+), 30 deletions(-) diff --git a/urflibs/urasm/expr.f b/urflibs/urasm/expr.f index c37fba3..ccac4cd 100644 --- a/urflibs/urasm/expr.f +++ b/urflibs/urasm/expr.f @@ -121,41 +121,27 @@ false value was-nameless-label-ref ;; peephole optimiser slows down everything a lot, disable it sinopt-temp-disable $ENDIF - here to bc-buffer-start + here to bc-buffer-start state 1! ; : bc-done ( -- ) - here to bc-buffer-end + here to bc-buffer-end state 0! $IF HAS-WORD("sinopt-temp-disable") AND HAS-WORD("sinopt-temp-restore") sinopt-temp-restore $ENDIF ; -(* -: bc-undo-all ( -- ) - bc-buffer-start 0< " cannot undo bc -- nothing to do" ?error - bc-buffer-start forth:(dp-main) ! - -1 to bc-buffer-start -; -*) - ;; throw on error : bc-run ( addr -- result TRUE / errorcode FALSE ) ['] (run-forth-at-addr) catch ?dup if nip ( drop `addr` ) false else true endif ; -: bc-do-as-compiler: ( cfa -- ) \ name word - create parse-skip-comments -find-required , - does> ( pfa ) - state @ >r compiler:comp! @execute r> state ! -; - -bc-do-as-compiler: bc-, ( n -- ) forth:, -bc-do-as-compiler: bc-compile, ( cfa -- ) compile, -bc-do-as-compiler: bc-compile ( -- ) compile immediate -bc-do-as-compiler: bc-emit-lit ( n -- ) literal -bc-do-as-compiler: bc-emit-strlit ( n -- ) strliteral +alias-for , is bc-, +alias-for compile, is bc-compile, +alias-for compile is bc-compile +alias-for literal is bc-emit-lit +alias-for strliteral is bc-emit-strlit : bc-emit-label ( addr count -- ) 2dup 1 = swap c@ [char] $ = and if @@ -175,15 +161,6 @@ bc-do-as-compiler: bc-emit-strlit ( n -- ) strliteral endif ; -(* -defer (get-macro-arg) ( addr count -- value ) -' (notimpl) to (get-macro-arg) - -: bc-emit-macarg ( addr count -- ) - bc-emit-strlit bc-compile (get-macro-arg) -; -*) - ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; generate code for expression evaluation (parser) -- 2.11.4.GIT