Skip to content

Commit 88680e6

Browse files
committed
added multi line comments
1 parent c7d0385 commit 88680e6

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

editors/micro_callisto.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,9 @@ rules:
3535
end: "$"
3636
rules:
3737
- todo: "(TODO|XXX|FIXME):?"
38+
39+
- comment:
40+
start: "\\("
41+
end: "\\)"
42+
rules:
43+
- todo: "(TODO|XXX|FIXME):?"

examples/comments.cal

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include "cores/select.cal"
2+
include "std/io.cal"
3+
4+
# This is a single line comment
5+
"hi\n" printstr
6+
7+
(
8+
This is a multi line comment
9+
)
10+
"hello\n" printstr

source/lexer.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ class Lexer {
219219
reading = format("%d", ch);
220220
break;
221221
}
222+
case '(': {
223+
while (code[i] != ')') {
224+
Next();
225+
}
226+
break;
227+
}
222228
default: {
223229
reading ~= code[i];
224230
}

0 commit comments

Comments
 (0)