Hash :
99f3ddcd
Author :
Date :
2021-06-13T22:00:43
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
struct foo {}
let foo: CStr;
let foo: &'a CStr;
let foo: &'a Foo<dyn Bar>;
Option::Some(foo);
Option::None;
// we can differentiate between enum variants and class names
// so let's make the bug a feature!
enum Foo {
Const,
Tuple(i8,i8),
Struct {
foo: u8
}
}
----------------------------------------------------
[
["keyword", "struct"],
["type-definition", "foo"],
["punctuation", "{"],
["punctuation", "}"],
["keyword", "let"],
" foo",
["punctuation", ":"],
["class-name", "CStr"],
["punctuation", ";"],
["keyword", "let"],
" foo",
["punctuation", ":"],
["operator", "&"],
["lifetime-annotation", "'a"],
["class-name", "CStr"],
["punctuation", ";"],
["keyword", "let"],
" foo",
["punctuation", ":"],
["operator", "&"],
["lifetime-annotation", "'a"],
["class-name", "Foo"],
["operator", "<"],
["keyword", "dyn"],
["class-name", "Bar"],
["operator", ">"],
["punctuation", ";"],
["class-name", "Option"],
["punctuation", "::"],
["class-name", "Some"],
["punctuation", "("],
"foo",
["punctuation", ")"],
["punctuation", ";"],
["class-name", "Option"],
["punctuation", "::"],
["class-name", "None"],
["punctuation", ";"],
["comment", "// we can differentiate between enum variants and class names"],
["comment", "// so let's make the bug a feature!"],
["keyword", "enum"],
["type-definition", "Foo"],
["punctuation", "{"],
["class-name", "Const"],
["punctuation", ","],
["class-name", "Tuple"],
["punctuation", "("],
["keyword", "i8"],
["punctuation", ","],
["keyword", "i8"],
["punctuation", ")"],
["punctuation", ","],
["class-name", "Struct"],
["punctuation", "{"],
"\r\n\t\tfoo",
["punctuation", ":"],
["keyword", "u8"],
["punctuation", "}"],
["punctuation", "}"]
]
----------------------------------------------------
Checks for class names and enum variants.