chroma/lexers/testdata/rust/string_interpol.expected
2025-03-22 20:46:00 +13:00

126 lines
5.5 KiB
Text

[
{"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":"KeywordDeclaration","value":"let"},
{"type":"TextWhitespace","value":" "},
{"type":"Name","value":"foo"},
{"type":"TextWhitespace","value":" "},
{"type":"Operator","value":"="},
{"type":"TextWhitespace","value":" "},
{"type":"LiteralStringChar","value":"'x'"},
{"type":"Punctuation","value":";"},
{"type":"TextWhitespace","value":"\n\n "},
{"type":"NameFunctionMagic","value":"println!"},
{"type":"Punctuation","value":"("},
{"type":"TextWhitespace","value":"\n "},
{"type":"LiteralString","value":"\"\n Kitchen sink\n "},
{"type":"LiteralStringEscape","value":"{{"},
{"type":"LiteralString","value":" "},
{"type":"LiteralStringEscape","value":"}}"},
{"type":"LiteralString","value":" - Escaped\n "},
{"type":"LiteralStringEscape","value":"{{"},
{"type":"LiteralStringInterpol","value":"{}"},
{"type":"LiteralStringEscape","value":"}}"},
{"type":"LiteralString","value":" - Escaped with inner interpol\n "},
{"type":"LiteralStringInterpol","value":"{foo:#?}"},
{"type":"LiteralString","value":" - Ident with pretty debug format\n "},
{"type":"LiteralStringInterpol","value":"{0:-\u003c5}"},
{"type":"LiteralString","value":" - Positional with complex fill/alignment\n \""},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":"\n "},
{"type":"Name","value":"foo"},
{"type":"Punctuation","value":","},
{"type":"TextWhitespace","value":"\n "},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n\n "},
{"type":"CommentSingle","value":"// Unconventional formatting\n"},
{"type":"TextWhitespace","value":" "},
{"type":"NameFunctionMagic","value":"println!"},
{"type":"TextWhitespace","value":"\t"},
{"type":"Punctuation","value":"("},
{"type":"TextWhitespace","value":"\t"},
{"type":"LiteralString","value":"\"Hello, "},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"!\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n\n "},
{"type":"CommentSingle","value":"// Exhausting the supported macros\n"},
{"type":"TextWhitespace","value":" "},
{"type":"NameFunctionMagic","value":"eprintln!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"eprint!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"println!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"print!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"format!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"format_args!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"panic!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"todo!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"unreachable!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n "},
{"type":"NameFunctionMagic","value":"unimplemented!"},
{"type":"Punctuation","value":"("},
{"type":"LiteralString","value":"\""},
{"type":"LiteralStringInterpol","value":"{foo}"},
{"type":"LiteralString","value":"\""},
{"type":"Punctuation","value":");"},
{"type":"TextWhitespace","value":"\n"},
{"type":"Punctuation","value":"}"},
{"type":"TextWhitespace","value":"\n"}
]