Skip to content

Commit b317ca4

Browse files
der-teufel-programmingkristoff-it
authored andcommitted
autodoc: Added line_comment tokens to ziglexer.js tokenizer
1 parent c4e62be commit b317ca4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/docs/index.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,8 @@
836836
}
837837

838838
.zig_doc_comment,
839-
.zig_container_doc_comment {
839+
.zig_container_doc_comment,
840+
.zig_line_comment {
840841
color: #545454;
841842
font-style: italic;
842843
}

lib/docs/ziglexer.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const Tag = {
1212
number_literal: "number_literal",
1313
doc_comment: "doc_comment",
1414
container_doc_comment: "container_doc_comment",
15+
line_comment: "line_comment",
1516
invalid_periodasterisks: "invalid_periodasterisks",
1617
bang: "bang",
1718
pipe: "pipe",
@@ -1699,9 +1700,9 @@ function InnerTokenizer(raw_source) {
16991700
return result;
17001701
}
17011702
case '\n': {
1702-
state = State.start;
1703-
result.loc.start = this.index + 1;
1704-
break;
1703+
result.tag = Tag.line_comment;
1704+
result.loc.end = this.index;
1705+
return result;
17051706
}
17061707
case '\t': break;
17071708
//TODO: PORT

0 commit comments

Comments
 (0)