mirror of
https://github.com/alecthomas/chroma.git
synced 2025-03-17 20:58:08 +02:00
Enable EnsureNL for TradingView and C# lexers
This commit is contained in:
parent
abbe00cecd
commit
8ce6ac6016
@ -13,6 +13,7 @@ var CSharp = internal.Register(MustNewLexer(
|
||||
Filenames: []string{"*.cs"},
|
||||
MimeTypes: []string{"text/x-csharp"},
|
||||
DotAll: true,
|
||||
EnsureNL: true,
|
||||
},
|
||||
Rules{
|
||||
"root": {
|
||||
|
@ -13,6 +13,7 @@ var TradingView = internal.Register(MustNewLexer(
|
||||
Filenames: []string{"*.tv"},
|
||||
MimeTypes: []string{"text/x-tradingview"},
|
||||
DotAll: true,
|
||||
EnsureNL: true,
|
||||
},
|
||||
Rules{
|
||||
"root": {
|
||||
|
2
lexers/testdata/csharp.actual
vendored
2
lexers/testdata/csharp.actual
vendored
@ -9,3 +9,5 @@ foreach (DriveInfo drive in drives)
|
||||
Console.WriteLine(dir);
|
||||
}
|
||||
}
|
||||
|
||||
// Comment as last line should be recognised properly
|
3
lexers/testdata/csharp.expected
vendored
3
lexers/testdata/csharp.expected
vendored
@ -69,5 +69,6 @@
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":"\n"},
|
||||
{"type":"Punctuation","value":"}"},
|
||||
{"type":"Text","value":"\n"}
|
||||
{"type":"Text","value":"\n\n"},
|
||||
{"type":"CommentSingle","value":"// Comment as last line should be recognised properly\n"}
|
||||
]
|
||||
|
2
lexers/testdata/tradingview.actual
vendored
2
lexers/testdata/tradingview.actual
vendored
@ -10,3 +10,5 @@ plot(series=emaVal, style=circles, offset=2, linewidth=3)
|
||||
bgcolor(color=close > open ? orange :
|
||||
close != high[1] ? purple :
|
||||
na, transp=80)
|
||||
|
||||
// Comment as last line should be recognised properly
|
4
lexers/testdata/tradingview.expected
vendored
4
lexers/testdata/tradingview.expected
vendored
@ -89,5 +89,7 @@
|
||||
{"type":"Text","value":", transp"},
|
||||
{"type":"KeywordPseudo","value":"="},
|
||||
{"type":"LiteralNumber","value":"80"},
|
||||
{"type":"Text","value":")\n"}
|
||||
{"type":"Text","value":")\n\n"},
|
||||
{"type":"CommentSingle","value":"// Comment as last line should be recognised properly"},
|
||||
{"type":"Text","value":"\n"}
|
||||
]
|
||||
|
Loading…
x
Reference in New Issue
Block a user