mirror of
https://github.com/alecthomas/chroma.git
synced 2025-04-11 11:32:05 +02:00
Using these examples: ~~~ 0x21 1_000 1e3 ~~~ Several languages failed that support these syntax. Here are ones I found: Lexer | 0x21 | 1_000 | 1e3 -----------|------|-------|----- C# | fail | fail | fail Go | | fail | JavaScript | | fail | fail PHP | | fail | Python | | fail | Ruby | | | fail I fixed these issues, and added tests.
97 lines
3.4 KiB
Plaintext
97 lines
3.4 KiB
Plaintext
[
|
|
{"type":"Name","value":"DriveInfo"},
|
|
{"type":"Punctuation","value":"[]"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"drives"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"DriveInfo"},
|
|
{"type":"Punctuation","value":"."},
|
|
{"type":"Name","value":"GetDrives"},
|
|
{"type":"Punctuation","value":"();"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Keyword","value":"foreach"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"DriveInfo"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"drive"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"in"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"drives"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"IEnumerable"},
|
|
{"type":"Punctuation","value":"\u003c"},
|
|
{"type":"KeywordType","value":"string"},
|
|
{"type":"Punctuation","value":"\u003e"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"driveFolders"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"="},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"Directory"},
|
|
{"type":"Punctuation","value":"."},
|
|
{"type":"Name","value":"EnumerateDirectories"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"drive"},
|
|
{"type":"Punctuation","value":"."},
|
|
{"type":"Name","value":"RootDirectory"},
|
|
{"type":"Punctuation","value":"."},
|
|
{"type":"Name","value":"ToString"},
|
|
{"type":"Punctuation","value":"());"},
|
|
{"type":"Text","value":"\n\n "},
|
|
{"type":"Keyword","value":"foreach"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"KeywordType","value":"string"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"dir"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Keyword","value":"in"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"driveFolders"},
|
|
{"type":"Punctuation","value":")"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Punctuation","value":"{"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Name","value":"Console"},
|
|
{"type":"Punctuation","value":"."},
|
|
{"type":"Name","value":"WriteLine"},
|
|
{"type":"Punctuation","value":"("},
|
|
{"type":"Name","value":"dir"},
|
|
{"type":"Punctuation","value":");"},
|
|
{"type":"Text","value":"\n "},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"Punctuation","value":"}"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"KeywordType","value":"int"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"n"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumber","value":"0x21"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"+"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumber","value":"1_000"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n"},
|
|
{"type":"KeywordType","value":"double"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Name","value":"n2"},
|
|
{"type":"Text","value":" "},
|
|
{"type":"Punctuation","value":"="},
|
|
{"type":"Text","value":" "},
|
|
{"type":"LiteralNumber","value":"1e3"},
|
|
{"type":"Punctuation","value":";"},
|
|
{"type":"Text","value":"\n\n"},
|
|
{"type":"CommentSingle","value":"// Comment as last line should be recognised properly\n"}
|
|
]
|