40c6b897ab
FossilOrigin-Name: 256a802203164209e63c63b3cbc42096766477147e221e63d887ad6ee7d5c31e
31 lines
561 B
Text
31 lines
561 B
Text
Support for comments with embedded spaces; this is useful for quickly
|
|
commenting out portions of lines or larger chunks of code during
|
|
debugging.
|
|
|
|
This provides for C style /* ... */ comments. It works by patching
|
|
`interpret` to make it ignore tokens until the token is */.
|
|
|
|
~~~
|
|
{{
|
|
:done? '*/ s:eq? ;
|
|
:revert &interpret unhook ;
|
|
---reveal---
|
|
:/* (-a) [ (a-) done? &revert if ] &interpret set-hook ; immediate
|
|
}}
|
|
~~~
|
|
|
|
# Test Case
|
|
|
|
```
|
|
:test /* hello world */
|
|
#1
|
|
|
|
/*
|
|
this is a test. drop stuff.
|
|
more lines
|
|
*/
|
|
|
|
#2 + /* display */ n:put nl ;
|
|
|
|
test
|
|
```
|