Add NULL as reserved keyword cpp (#17803)

* [cpp]Do not lowercase the reserved keywords for C++

(Will be necessary for adding NULL as a reserved keyword)

* [cpp]Add NULL as reserved keyword
This commit is contained in:
Miklós Márton 2024-02-23 09:00:23 +01:00 committed by GitHub
parent a6771adf53
commit c4f90d058b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,6 +41,7 @@ import java.io.IOException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
@ -61,7 +62,7 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg
/* /*
* Reserved words. Override this with reserved words specific to your language * Reserved words. Override this with reserved words specific to your language
*/ */
setReservedWordsLowerCase( reservedWords = new HashSet<>(
Arrays.asList( Arrays.asList(
"alignas", "alignas",
"alignof", "alignof",
@ -112,6 +113,7 @@ abstract public class AbstractCppCodegen extends DefaultCodegen implements Codeg
"noexcept", "noexcept",
"not", "not",
"not_eq", "not_eq",
"NULL",
"nullptr", "nullptr",
"operator", "operator",
"or", "or",