From 36bc6b8596331f576ff32d4f634c8103b249ca30 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 19 Nov 2020 11:58:41 -0500 Subject: [PATCH] [mtl] populate reserved words more --- src/back/msl/mod.rs | 98 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 1 deletion(-) diff --git a/src/back/msl/mod.rs b/src/back/msl/mod.rs index 9f105ddafc..3bc329e89f 100644 --- a/src/back/msl/mod.rs +++ b/src/back/msl/mod.rs @@ -27,7 +27,103 @@ use std::{ //TODO: find a complete list const RESERVED_WORDS: &[&str] = &[ - "if", "switch", "while", "for", "main", "struct", "new", "const", "device", + // control flow + "break", + "if", + "else", + "continue", + "goto", + "do", + "while", + "for", + "switch", + "case", + // types and values + "void", + "unsigned", + "signed", + "bool", + "char", + "int", + "long", + "float", + "double", + "char8_t", + "wchar_t", + "true", + "false", + "nullptr", + "union", + "class", + "struct", + "enum", + // other + "main", + "decltype", + "sizeof", + "typeof", + "typedef", + "explicit", + "export", + "friend", + "namespace", + "operator", + "public", + "template", + "typename", + "typeid", + "co_await", + "co_return", + "co_yield", + "module", + "import", + "ray_data", + "vec_step", + "visible", + "as_type", + // qualifiers + "mutable", + "static", + "volatile", + "restrict", + "const", + "non-temporal", + "dereferenceable", + "invariant", + // exceptions + "throw", + "try", + "catch", + // operators + "const_cast", + "dynamic_cast", + "reinterpret_cast", + "static_cast", + "new", + "delete", + "and", + "and_eq", + "bitand", + "bitor", + "compl", + "not", + "not_eq", + "or", + "or_eq", + "xor", + "xor_eq", + "compl", + // Metal-specific + "constant", + "device", + "threadgroup", + "threadgroup_imageblock", + "compute", + "vertex", + "fragment", + "read_only", + "write_only", + "read_write", ]; #[derive(Clone, Debug, Default, PartialEq)]