- ABORT
- ABORT"
- ABS
- ACCEPT
- ACTION-OF
- AGAIN
- ALIGN
- ALIGNED
- ALLOT
- AND
- BASE
- BEGIN
- BL
- BUFFER:
- [
- [CHAR]
- [COMPILE]
- [']
- CASE
- C,
- CELL+
- CELLS
- C@
- CHAR
- CHAR+
- CHARS
- COMPILE,
- CONSTANT
- COUNT
- CR
- CREATE
- C!
- :
- :NONAME
- ,
- C"
- DECIMAL
- DEFER
- DEFER@
- DEFER!
- DEPTH
- DO
- DOES>
- DROP
- DUP
- /
- /MOD
- .R
- .(
- ."
- ELSE
- EMIT
- ENDCASE
- ENDOF
- ENVIRONMENT?
- ERASE
- EVALUATE
- EXECUTE
- EXIT
- =
- FALSE
- FILL
- FIND
- FM/MOD
- @
- HERE
- HEX
- HOLD
- HOLDS
- I
- IF
- IMMEDIATE
- INVERT
- IS
- J
- KEY
- LEAVE
- LITERAL
- LOOP
- LSHIFT
- MARKER
- MAX
- MIN
- MOD
- MOVE
- M*
- -
- NEGATE
- NIP
- OF
- OR
- OVER
- 1-
- 1+
- PAD
- PARSE-NAME
- PARSE
- PICK
- POSTPONE
- +
- +LOOP
- +!
- QUIT
- RECURSE
- REFILL
- REPEAT
- RESTORE-INPUT
- R@
- ROLL
- ROT
- RSHIFT
- R>
- SAVE-INPUT
- SIGN
- SM/REM
- SOURCE-ID
- SOURCE
- SPACE
- SPACES
- STATE
- SWAP
- ;
- S\"
- S"
- S>D
- !
- THEN
- TO
- TRUE
- TUCK
- TYPE
- '
- *
- */
- */MOD
- 2DROP
- 2DUP
- 2/
- 2@
- 2OVER
- 2R@
- 2R>
- 2SWAP
- 2!
- 2*
- 2>R
- U.R
- UM/MOD
- UM*
- UNLOOP
- UNTIL
- UNUSED
- U.
- U<
- U>
- VALUE
- VARIABLE
- WHILE
- WITHIN
- WORD
- XOR
- 0=
- 0<
- 0>
- 0<>
- \
- .
- <
- >
- <>
- #>
- <#
- #
- #S
- (
- ?DO
- ?DUP
- >BODY
- >IN
- >NUMBER
- >R
6.1.0080 ( paren CORE
Compilation:
Execution:
Parse ccc delimited by )
(right parenthesis).
( is an immediate word.
The number of characters in ccc may be zero to the number of characters in the parse area.
See:
Rationale:
)
...
Testing:
T{ ( A comment)1234 -> }T
T{ : pc1 ( A comment)1234 ; pc1 -> 1234 }T
ContributeContributions
ruv
[132] "(" typo in a testcaseComment2020-02-25 23:15:38
The following line:
T{ ( A comment)1234 -> }T
has a typo, the missed stack effect 1234
. It should be:
T{ ( A comment)1234 -> 1234 }T
EricBlake
[380] Can balanced () be nested inside ( and .( comments?Request for clarification2025-06-30 18:21:53
The text is unclear on whether "ccc)" as the text to be parsed after recognition of the "(" and ".(" words may include nesting of (). Table 2.1 in 2.2.3 Parsed text notation states merely
ccc a parsed sequence of arbitrary characters, excluding the delimiter character
which at strict reading would state that a comment cannot contain ")" and therefore probably should not contain "(". But in practice, it seems several Forth implementations have ALWAYS supported comments such as "( n -- n' (n modified by ...) )", and where you can quickly add another layer of () around large blocks of code if "(" automatically refills the input buffer until finding the final balancing ")". For an example, here is the jonesforth implementation: http://git.annexia.org/?p=jonesforth.git;a=blob;f=jonesforth.f;h=5c1309574a;hb=66c569981#l216
If this is desirable, the specification for "(" and/or for the Parsed text notation definition of ccc needs to be updated to account for nesting. If it is not desirable to mandate this (but to still allow implementations that support it), the text for "(" and ".(" should probably document that it is ambiguous behavior if "(" appears in the "ccc)" word.
https://www.reddit.com/r/Forth/comments/69nivq/is_there_a_good_way_to_do_nested_comments_in_ans/ is an interesting discussion on the topic.