diff --git a/tool/src/org/antlr/v4/codegen/target/Python2Target.java b/tool/src/org/antlr/v4/codegen/target/Python2Target.java index 3fc6a35418..28dfaae607 100644 --- a/tool/src/org/antlr/v4/codegen/target/Python2Target.java +++ b/tool/src/org/antlr/v4/codegen/target/Python2Target.java @@ -24,27 +24,28 @@ */ public class Python2Target extends Target { protected static final String[] python2Keywords = { - "abs", "all", "any", "apply", "as", - "bin", "bool", "buffer", "bytearray", - "callable", "chr", "classmethod", "coerce", "compile", "complex", - "del", "delattr", "dict", "dir", "divmod", - "enumerate", "eval", "execfile", - "file", "filter", "float", "format", "frozenset", - "getattr", "globals", + "abs", "all", "and", "any", "apply", "as", "assert", + "bin", "bool", "break", "buffer", "bytearray", + "callable", "chr", "class", "classmethod", "coerce", "compile", "complex", "continue", + "def", "del", "delattr", "dict", "dir", "divmod", + "elif", "else", "enumerate", "eval", "except", "exec", "execfile", + "file", "filter", "finally", "float", "for", "format", "from", "frozenset", + "getattr", "global", "globals", "hasattr", "hash", "help", "hex", - "id", "input", "int", "intern", "isinstance", "issubclass", "iter", - "len", "list", "locals", - "map", "max", "min", "next", + "id", "if", "import", "in", "input", "int", "intern", "is", "isinstance", "issubclass", "iter", + "lambda", "len", "list", "locals", + "map", "max", "min", "next", "not", "memoryview", - "object", "oct", "open", "ord", - "pow", "print", "property", - "range", "raw_input", "reduce", "reload", "repr", "return", "reversed", "round", + "object", "oct", "open", "or", "ord", + "pass", "pow", "print", "property", + "raise", "range", "raw_input", "reduce", "reload", "repr", "return", "reversed", "round", "set", "setattr", "slice", "sorted", "staticmethod", "str", "sum", "super", - "tuple", "type", + "try", "tuple", "type", "unichr", "unicode", "vars", - "with", + "while", "with", "xrange", + "yield", "zip", "__import__", "True", "False", "None" diff --git a/tool/src/org/antlr/v4/codegen/target/Python3Target.java b/tool/src/org/antlr/v4/codegen/target/Python3Target.java index 388269a738..1dffc4e42e 100644 --- a/tool/src/org/antlr/v4/codegen/target/Python3Target.java +++ b/tool/src/org/antlr/v4/codegen/target/Python3Target.java @@ -24,26 +24,27 @@ */ public class Python3Target extends Target { protected static final String[] python3Keywords = { - "abs", "all", "any", "apply", "as", - "bin", "bool", "buffer", "bytearray", - "callable", "chr", "classmethod", "coerce", "compile", "complex", - "del", "delattr", "dict", "dir", "divmod", - "enumerate", "eval", "execfile", - "file", "filter", "float", "format", "frozenset", - "getattr", "globals", + "abs", "all", "and", "any", "apply", "as", "assert", + "bin", "bool", "break", "buffer", "bytearray", + "callable", "chr", "class", "classmethod", "coerce", "compile", "complex", "continue", + "def", "del", "delattr", "dict", "dir", "divmod", + "elif", "else", "enumerate", "eval", "execfile", "except", + "file", "filter", "finally", "float", "for", "format", "from", "frozenset", + "getattr", "global", "globals", "hasattr", "hash", "help", "hex", - "id", "input", "int", "intern", "isinstance", "issubclass", "iter", - "len", "list", "locals", - "map", "max", "min", "next", - "memoryview", - "object", "oct", "open", "ord", - "pow", "print", "property", - "range", "raw_input", "reduce", "reload", "repr", "return", "reversed", "round", + "id", "if", "import", "in", "input", "int", "intern", "is", "isinstance", "issubclass", "iter", + "lambda", "len", "list", "locals", + "map", "max", "min", "memoryview", + "next", "nonlocal", "not", + "object", "oct", "open", "or", "ord", + "pass", "pow", "print", "property", + "raise", "range", "raw_input", "reduce", "reload", "repr", "return", "reversed", "round", "set", "setattr", "slice", "sorted", "staticmethod", "str", "sum", "super", - "tuple", "type", + "try", "tuple", "type", "unichr", "unicode", "vars", - "with", + "with", "while", + "yield", "zip", "__import__", "True", "False", "None"