Wrote multiline comment

This commit is contained in:
Koichi Nakamura 2021-01-01 20:35:09 +09:00
parent 462362f192
commit e11e1f782e

22
core.fs
View file

@ -682,6 +682,28 @@ alias-builtin xor ^
latest @ >cfa ,
; immediate
\ === Multiline Comment ===
: '(' [ key ( ] literal ;
: ')' [ key ) ] literal ;
: (
1 \ depth counter
begin
key
dup '(' = if
drop 1+ \ increase depth
else
')' = if
1- \ decrease depth
then
then
dup 0= until
drop
; immediate
(
Now we can use multiline comment with ( nests. )
)
bye