From b317ca4d6f76e32e9afb72dde59e43d515b6033b Mon Sep 17 00:00:00 2001 From: Krzysztof Wolicki Date: Tue, 25 Jul 2023 23:17:33 +0200 Subject: [PATCH] autodoc: Added line_comment tokens to ziglexer.js tokenizer --- lib/docs/index.html | 3 ++- lib/docs/ziglexer.js | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/docs/index.html b/lib/docs/index.html index febcec2f4aef..6930eeb0684b 100644 --- a/lib/docs/index.html +++ b/lib/docs/index.html @@ -836,7 +836,8 @@ } .zig_doc_comment, - .zig_container_doc_comment { + .zig_container_doc_comment, + .zig_line_comment { color: #545454; font-style: italic; } diff --git a/lib/docs/ziglexer.js b/lib/docs/ziglexer.js index e049657cbf19..234a95fc4060 100644 --- a/lib/docs/ziglexer.js +++ b/lib/docs/ziglexer.js @@ -12,6 +12,7 @@ const Tag = { number_literal: "number_literal", doc_comment: "doc_comment", container_doc_comment: "container_doc_comment", + line_comment: "line_comment", invalid_periodasterisks: "invalid_periodasterisks", bang: "bang", pipe: "pipe", @@ -1699,9 +1700,9 @@ function InnerTokenizer(raw_source) { return result; } case '\n': { - state = State.start; - result.loc.start = this.index + 1; - break; + result.tag = Tag.line_comment; + result.loc.end = this.index; + return result; } case '\t': break; //TODO: PORT