class Noir::Lexers::Python
- Noir::Lexers::Python
- Noir::Lexer
- Reference
- Object
Defined in:
noir/lexers/python.crConstant Summary
-
BUILTINS =
Set.new(["__import__", "abs", "all", "any", "apply", "basestring", "bin", "bool", "buffer", "bytearray", "bytes", "callable", "chr", "classmethod", "cmp", "coerce", "compile", "complex", "delattr", "dict", "dir", "divmod", "enumerate", "eval", "execfile", "exit", "file", "filter", "float", "frozenset", "getattr", "globals", "hasattr", "hash", "hex", "id", "input", "int", "intern", "isinstance", "issubclass", "iter", "len", "list", "locals", "long", "map", "max", "min", "next", "object", "oct", "open", "ord", "pow", "property", "range", "raw_input", "reduce", "reload", "repr", "reversed", "round", "set", "setattr", "slice", "sorted", "staticmethod", "str", "sum", "super", "tuple", "type", "unichr", "unicode", "vars", "xrange", "zip"] of ::String)
-
BUILTINS_PSEUDO =
Set.new(["self", "None", "Ellipsis", "NotImplemented", "False", "True"] of ::String)
-
DOTTED_IDENTIFIER =
/[a-z_.][a-z0-9_.]*/i
-
EXCEPTIONS =
Set.new(["ArithmeticError", "AssertionError", "AttributeError", "BaseException", "DeprecationWarning", "EOFError", "EnvironmentError", "Exception", "FloatingPointError", "FutureWarning", "GeneratorExit", "IOError", "ImportError", "ImportWarning", "IndentationError", "IndexError", "KeyError", "KeyboardInterrupt", "LookupError", "MemoryError", "NameError", "NotImplemented", "NotImplementedError", "OSError", "OverflowError", "OverflowWarning", "PendingDeprecationWarning", "ReferenceError", "RuntimeError", "RuntimeWarning", "StandardError", "StopIteration", "SyntaxError", "SyntaxWarning", "SystemError", "SystemExit", "TabError", "TypeError", "UnboundLocalError", "UnicodeDecodeError", "UnicodeEncodeError", "UnicodeError", "UnicodeTranslateError", "UnicodeWarning", "UserWarning", "ValueError", "VMSError", "Warning", "WindowsError", "ZeroDivisionError"] of ::String)
-
IDENTIFIER =
/[a-z_][a-z0-9_]*/i
-
KEYWORDS =
Set.new(["assert", "break", "continue", "del", "elif", "else", "except", "exec", "finally", "for", "global", "if", "lambda", "pass", "print", "raise", "return", "try", "while", "yield", "as", "with", "from", "import", "yield", "async", "await"] of ::String)
Instance methods inherited from class Noir::Lexer
current_state
current_state,
lex_all(input : String, output : Formatter)
lex_all,
stack : Deque(Noir::Lexer::State)
stack,
state(name)
state
Constructor methods inherited from class Noir::Lexer
new
new
Class methods inherited from class Noir::Lexer
aliases(aliases : Array(String))aliases aliases, append(name, &) append, filenames(filenames : Array(String))
filenames filenames, mimetypes(mimetypes : Array(String))
mimetypes mimetypes, prepend(name, &) prepend, state(name : Symbol)
state(name : Symbol, &) state, tag(tag : String)
tag : String tag, tag? : String | Nil tag?