Skip to content

Commit 9c8fead

Browse files
committed
docs: #142 multiline comments
1 parent a3d54d6 commit 9c8fead

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

content/documentation/basic-types.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,13 +140,22 @@ A set is a sequence of whitespace-separated values prefixed by the function `set
140140

141141
## Comments
142142

143-
A comment begins with a `#` or `;` character and continues until the end of the line. There are no multi-line comments.
143+
A comment begins with a `#` or `;` character and continues until the end of the line.
144144

145145
```phel
146146
# This is a comment
147147
; This is also a comment
148148
```
149149

150+
Phel also supports multiline comments using the Common Lisp `#|` ... `|#` syntax. The comment spans everything between the opening and closing markers, including line breaks.
151+
152+
```phel
153+
#|
154+
This whole block
155+
is a comment
156+
|#
157+
```
158+
150159
Phel also supports inline s-expression commenting with `#_` which comments out the next form. It can also be stacked to comment out two or more forms after it.
151160

152161
```phel

syntaxes/phel.sublime-syntax

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ contexts:
1818
#- include: symbol
1919

2020
comment:
21+
# Multiline block comments: start with #| and end with |#
22+
- match: '#\|'
23+
scope: punctuation.definition.comment.begin.phel
24+
push:
25+
- meta_scope: comment.block.phel
26+
- match: '\|#'
27+
scope: punctuation.definition.comment.end.phel
28+
pop: true
29+
30+
# Single-line comments: ; ... or # ... (but not "#{")
2131
- match: (;|#(?!\{)).*$
2232
scope: comment.line.hash-or-semicolon.phel
2333
captures:

0 commit comments

Comments
 (0)