Skip to content

Commit

Permalink
added multi line comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MESYETI committed Aug 14, 2024
1 parent c7d0385 commit 88680e6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions editors/micro_callisto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ rules:
end: "$"
rules:
- todo: "(TODO|XXX|FIXME):?"

- comment:
start: "\\("
end: "\\)"
rules:
- todo: "(TODO|XXX|FIXME):?"
10 changes: 10 additions & 0 deletions examples/comments.cal
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
include "cores/select.cal"
include "std/io.cal"

# This is a single line comment
"hi\n" printstr

(
This is a multi line comment
)
"hello\n" printstr
6 changes: 6 additions & 0 deletions source/lexer.d
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ class Lexer {
reading = format("%d", ch);
break;
}
case '(': {
while (code[i] != ')') {
Next();
}
break;
}
default: {
reading ~= code[i];
}
Expand Down

0 comments on commit 88680e6

Please sign in to comment.