define comment? comment?
namespace comment?
define ENDER
calminstruction start? &line&
take ENDER, line
arrange line, =mvmacro ?, =comment?=.=intercept?
assemble line
end calminstruction
calminstruction intercept?! &line&
local ender, text, nested
arrange ender, ENDER
match , ender
jyes default_close
custom_close:
arrange text, line
stringify ender
stringify text
check ender = text
jyes clear
jump maybe_nested
default_close:
match =END? =COMMENT?, line
jyes clear
maybe_nested:
match =COMMENT? nested?, line
jno skip
take ENDER, nested
skip:
exit
clear:
take , ENDER
take ENDER, ENDER
jyes skip
arrange line, =mvmacro =comment?=.=intercept?, ?
assemble line
end calminstruction
restore ENDER
end namespace
mvmacro comment?, comment?.start?
Dual mode in that it supports a comment terminator token and an "end comment" style termination.
Nesting because sources could be long.
comment
any tokenizable source text
comment
nested text
end comment
end comment
comment ~
this block closes only on ~
end comment is ordinary text here
~
comment End Comment
; even this works, lol!
end comment
End Comment