Fix highlighting of special token sequences and script lines
This commit is contained in:
parent
258aa066f7
commit
3081fa86c2
|
@ -49,6 +49,8 @@ html { background-color: #fdf6e3; color: #002b36; }
|
||||||
writeSpan("num", t.text);
|
writeSpan("num", t.text);
|
||||||
else if (isOperator(t.type))
|
else if (isOperator(t.type))
|
||||||
writeSpan("op", str(t.type));
|
writeSpan("op", str(t.type));
|
||||||
|
else if (t.type == tok!"specialTokenSequence" || t.type == tok!"scriptLine")
|
||||||
|
writeSpan("cons", t.text.replace("<", "<"));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
version(Windows)
|
version(Windows)
|
||||||
|
|
1
main.d
1
main.d
|
@ -101,6 +101,7 @@ int main(string[] args)
|
||||||
config.whitespaceBehavior = WhitespaceBehavior.include;
|
config.whitespaceBehavior = WhitespaceBehavior.include;
|
||||||
config.stringBehavior = StringBehavior.source;
|
config.stringBehavior = StringBehavior.source;
|
||||||
config.commentBehavior = CommentBehavior.include;
|
config.commentBehavior = CommentBehavior.include;
|
||||||
|
config.specialTokenBehavior = SpecialTokenBehavior.include;
|
||||||
auto tokens = byToken(bytes, config, cache);
|
auto tokens = byToken(bytes, config, cache);
|
||||||
if (highlight)
|
if (highlight)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,7 +41,7 @@ private enum dynamicTokens = [
|
||||||
"whitespace", "doubleLiteral", "floatLiteral", "idoubleLiteral",
|
"whitespace", "doubleLiteral", "floatLiteral", "idoubleLiteral",
|
||||||
"ifloatLiteral", "intLiteral", "longLiteral", "realLiteral",
|
"ifloatLiteral", "intLiteral", "longLiteral", "realLiteral",
|
||||||
"irealLiteral", "uintLiteral", "ulongLiteral", "characterLiteral",
|
"irealLiteral", "uintLiteral", "ulongLiteral", "characterLiteral",
|
||||||
"dstringLiteral", "stringLiteral", "wstringLiteral", "scriptLine"
|
"dstringLiteral", "stringLiteral", "wstringLiteral"
|
||||||
];
|
];
|
||||||
|
|
||||||
private enum pseudoTokenHandlers = [
|
private enum pseudoTokenHandlers = [
|
||||||
|
|
Loading…
Reference in New Issue