contrib/jwrapper: add some top-level methods to the reserved keywords
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 23 Jul 2015 21:50:10 +0000 (17:50 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Fri, 24 Jul 2015 16:35:12 +0000 (12:35 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/jwrapper/src/code_generator.nit

index f164bca..0d93ffa 100644 (file)
@@ -272,11 +272,17 @@ redef class Sys
        # List of Nit keywords
        #
        # These may also be keywords in Java, but there they would be used capitalized.
-       private var nit_keywords: Array[String] = ["abort", "abstract", "and", "assert",
+       private var nit_keywords = new HashSet[String].from(["abort", "abstract", "and", "assert",
                "break", "class", "continue", "do", "else", "end", "enum", "extern", "false", "implies",
                "import", "init", "interface", "intrude", "if", "in", "is", "isa", "isset", "for", "label",
                "loop", "module", "new", "not", "null", "nullable", "or", "package", "private",
-               "protected", "public", "return", "self", "super", "then", "true", "type", "var", "while"]
+               "protected", "public", "return", "self", "super", "then", "true", "type", "var", "while",
+
+       # Top-level methods
+               "class_name", "get_time", "hash", "is_same_type", "is_same_instance", "output",
+
+       # Pointer or JavaObject methods
+               "free"])
 end
 
 redef class String