Added lexars

This commit is contained in:
Toastie 2025-03-22 20:46:00 +13:00
parent 382b2ce94b
commit f9f64b0558
Signed by: toastie_t0ast
GPG key ID: 0861BE54AD481DC7
820 changed files with 149371 additions and 0 deletions
lexers/testdata/rust

View file

@ -0,0 +1,92 @@
[
{"type":"Keyword","value":"use"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"smallvec"},
{"type":"Text","value":"::"},
{"type":"Punctuation","value":"{"},
{"type":"Name","value":"smallvec"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"SmallVec"},
{"type":"Punctuation","value":"};"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Name","value":"lazy_static"},
{"type":"Text","value":"::"},
{"type":"NameFunctionMagic","value":"lazy_static!"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n "},
{"type":"Keyword","value":"static"},
{"type":"TextWhitespace","value":" "},
{"type":"Keyword","value":"ref"},
{"type":"TextWhitespace","value":" "},
{"type":"NameConstant","value":"ONE"},
{"type":"Text","value":": "},
{"type":"KeywordType","value":"usize"},
{"type":"Text","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberInteger","value":"1"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n\n"},
{"type":"Keyword","value":"fn"},
{"type":"Text","value":" "},
{"type":"NameFunction","value":"main"},
{"type":"Punctuation","value":"()"},
{"type":"TextWhitespace","value":" "},
{"type":"Punctuation","value":"{"},
{"type":"TextWhitespace","value":"\n "},
{"type":"Name","value":"pretty_assertions"},
{"type":"Text","value":"::"},
{"type":"NameFunctionMagic","value":"assert_eq!"},
{"type":"Punctuation","value":"("},
{"type":"Operator","value":"*"},
{"type":"NameConstant","value":"ONE"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"*"},
{"type":"NameConstant","value":"ONE"},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"KeywordDeclaration","value":"let"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"_"},
{"type":"Text","value":": "},
{"type":"NameClass","value":"SmallVec"},
{"type":"Operator","value":"\u003c"},
{"type":"Punctuation","value":"["},
{"type":"Name","value":"_"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberInteger","value":"16"},
{"type":"Punctuation","value":"]"},
{"type":"Operator","value":"\u003e"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"NameFunctionMagic","value":"smallvec!"},
{"type":"Punctuation","value":"["},
{"type":"LiteralNumberInteger","value":"1"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberInteger","value":"2"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralNumberInteger","value":"3"},
{"type":"Punctuation","value":"];"},
{"type":"TextWhitespace","value":"\n\n "},
{"type":"CommentSingle","value":"// And some builtin ones\n"},
{"type":"TextWhitespace","value":" "},
{"type":"NameFunctionMagic","value":"println!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\"Hello, world!\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"panic!"},
{"type":"Punctuation","value":"();"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n"}
]