X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=blobdiff_plain;f=src%2Flib_3_comments.4th;h=1c0be393830095e8382b3f5111867eb6a3437f13;hp=a5b695b6ef8b5dcfc8e66d53ca279478a8d26812;hb=c52194127d604bd365f7222936b46f34f62a4814;hpb=213140aac1ad3c08a74dd5eea06464c474d54cd2 diff --git a/src/lib_3_comments.4th b/src/lib_3_comments.4th index a5b695b..1c0be39 100644 --- a/src/lib_3_comments.4th +++ b/src/lib_3_comments.4th @@ -3,17 +3,17 @@ : ( IMMEDIATE 1 \ allowed nested parens by keeping track of depth BEGIN - >IN @ #TIB @ >= IF \ End of TIB? - QUERY \ Get next line + >IN @ #IB @ >= IF \ End of TIB? + QUERY-INPUT \ Get next line THEN - TIB >IN @ + @ 1 >IN +! - DUP [CHAR] ( = IF \ open paren? + IB >IN @ + @ 1 >IN +! + DUP [CHAR] ( = IF \ open paren? DROP \ drop the open paren 1+ \ depth increases ELSE - [CHAR] ) = IF \ close paren? - 1- \ depth decreases + [CHAR] ) = IF \ close paren? + 1- \ depth decreases THEN THEN DUP 0= UNTIL \ continue until we reach matching close paren, depth 0