Unverified Commit 60ed0899 authored by Conor Shipp's avatar Conor Shipp Committed by GitHub

Reserve some Scheme keywords (#2319)

parent 713ff82b
......@@ -973,11 +973,11 @@ public interface OdeMessages extends Messages, AutogeneratedOdeMessages {
@DefaultMessage("Name cannot be any of the following: CsvUtil, Double, Float, " +
"Integer, JavaCollection, JavaIterator, KawaEnvironment, Long, Short, SimpleForm, String, " +
"Pattern, YailList, YailNumberToString, YailRuntimeError, abstract, continue, for, new, " +
"Pattern, YailDictionary, YailList, YailNumberToString, YailRuntimeError, abstract, continue, for, new, " +
"switch, assert, default, goto, package, synchronized, boolean, do, if, private, this, break, " +
"double, implements, protected, throw, byte, else, import, public, throws, case, enum, instanceof, " +
"return, transient, catch, extends, int, short, try, char, final, interface, static, void, class, " +
"finally, long, strictfp, volatile, const, float, native, super, while")
"finally, long, strictfp, volatile, const, float, native, super, while, begin, def, foreach, forrange, JavaStringUtils, quote")
@Description("Error shown when a new name is a reserved name in Yail or Java code")
String reservedNameError();
......
......@@ -26,7 +26,7 @@ public final class TextValidators {
protected static final List<String> YAIL_NAMES = Arrays.asList("CsvUtil", "Double", "Float",
"Integer", "JavaCollection", "JavaIterator", "KawaEnvironment", "Long", "Short",
"SimpleForm", "String", "Pattern", "YailList", "YailNumberToString", "YailRuntimeError");
"SimpleForm", "String", "Pattern", "YailDictionary", "YailList", "YailNumberToString", "YailRuntimeError");
protected static final List<String> JAVA_NAMES = Arrays.asList("abstract", "continue", "for", "new", "switch",
"assert", "default", "goto", "package", "synchronized", "boolean", "do", "if", "private", "this",
......@@ -35,6 +35,8 @@ public final class TextValidators {
"final", "interface", "static", "void", "class", "finally", "long", "strictfp", "volatile", "const",
"float", "native", "super", "while");
protected static final List<String> SCHEME_NAMES = Arrays.asList("begin", "def", "foreach", "forrange", "JavaStringUtils", "quote");
// This class should never be instantiated.
private TextValidators() {}
......@@ -139,7 +141,7 @@ public final class TextValidators {
* otherwise
*/
public static boolean isReservedName(String text) {
return (YAIL_NAMES.contains(text) || JAVA_NAMES.contains(text));
return (YAIL_NAMES.contains(text) || JAVA_NAMES.contains(text) || SCHEME_NAMES.contains(text));
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment