Skip to content

Commit de80139

Browse files
authored
Merge pull request #366 from flisky/keywords
fix keywords schema testing
2 parents de2f4ae + 3084fd9 commit de80139

File tree

1 file changed

+7
-60
lines changed

1 file changed

+7
-60
lines changed

graphql_client_codegen/src/codegen/shared.rs

Lines changed: 7 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,14 @@ use proc_macro2::TokenStream;
22
use quote::quote;
33
use std::borrow::Cow;
44

5-
// List of keywords based on https://doc.rust-lang.org/grammar.html#keywords
5+
// List of keywords based on https://doc.rust-lang.org/reference/keywords.html
6+
// code snippet: `[...new Set($$("code.hljs").map(x => x.textContent).filter(x => x.match(/^[_a-z0-9]+$/i)))].sort()`
67
const RUST_KEYWORDS: &[&str] = &[
7-
"abstract",
8-
"alignof",
9-
"as",
10-
"async",
11-
"await",
12-
"become",
13-
"box",
14-
"break",
15-
"const",
16-
"continue",
17-
"crate",
18-
"do",
19-
"else",
20-
"enum",
21-
"extern crate",
22-
"extern",
23-
"false",
24-
"final",
25-
"fn",
26-
"for",
27-
"for",
28-
"if let",
29-
"if",
30-
"if",
31-
"impl",
32-
"impl",
33-
"in",
34-
"let",
35-
"loop",
36-
"macro",
37-
"match",
38-
"mod",
39-
"move",
40-
"mut",
41-
"offsetof",
42-
"override",
43-
"priv",
44-
"proc",
45-
"pub",
46-
"pure",
47-
"ref",
48-
"return",
49-
"self",
50-
"sizeof",
51-
"static",
52-
"struct",
53-
"super",
54-
"trait",
55-
"true",
56-
"type",
57-
"typeof",
58-
"unsafe",
59-
"unsized",
60-
"use",
61-
"use",
62-
"virtual",
63-
"where",
64-
"while",
65-
"yield",
8+
"Self", "abstract", "as", "async", "await", "become", "box", "break", "const", "continue",
9+
"crate", "do", "dyn", "else", "enum", "extern", "false", "final", "fn", "for", "if", "impl",
10+
"in", "let", "loop", "macro", "match", "mod", "move", "mut", "override", "priv", "pub", "ref",
11+
"return", "self", "static", "struct", "super", "trait", "true", "try", "type", "typeof",
12+
"union", "unsafe", "unsized", "use", "virtual", "where", "while", "yield",
6613
];
6714

6815
pub(crate) fn keyword_replace<'a>(needle: impl Into<Cow<'a, str>>) -> Cow<'a, str> {

0 commit comments

Comments
 (0)