diff --git a/highlighter.d b/highlighter.d index 3be4c0c..cf48e27 100644 --- a/highlighter.d +++ b/highlighter.d @@ -49,6 +49,8 @@ html { background-color: #fdf6e3; color: #002b36; } writeSpan("num", t.text); else if (isOperator(t.type)) writeSpan("op", str(t.type)); + else if (t.type == tok!"specialTokenSequence" || t.type == tok!"scriptLine") + writeSpan("cons", t.text.replace("<", "<")); else { version(Windows) diff --git a/main.d b/main.d index 89a822d..cb011f8 100644 --- a/main.d +++ b/main.d @@ -101,6 +101,7 @@ int main(string[] args) config.whitespaceBehavior = WhitespaceBehavior.include; config.stringBehavior = StringBehavior.source; config.commentBehavior = CommentBehavior.include; + config.specialTokenBehavior = SpecialTokenBehavior.include; auto tokens = byToken(bytes, config, cache); if (highlight) { diff --git a/std/d/lexer.d b/std/d/lexer.d index abdc99e..03095b7 100644 --- a/std/d/lexer.d +++ b/std/d/lexer.d @@ -41,7 +41,7 @@ private enum dynamicTokens = [ "whitespace", "doubleLiteral", "floatLiteral", "idoubleLiteral", "ifloatLiteral", "intLiteral", "longLiteral", "realLiteral", "irealLiteral", "uintLiteral", "ulongLiteral", "characterLiteral", - "dstringLiteral", "stringLiteral", "wstringLiteral", "scriptLine" + "dstringLiteral", "stringLiteral", "wstringLiteral" ]; private enum pseudoTokenHandlers = [