"Fossies" - the Fresh Open Source Software Archive

Member "highlight-3.57-x64/langDefs/python.lang" (12 May 2020, 2822 Bytes) of package /windows/www/highlight-3.57-x64.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "python.lang": 3.53_vs_3.54.

    1 Description="Python"
    2 
    3 Categories = {"source", "script"}
    4 
    5 Digits=[[ (?:0x|0X|0o|0O|0b|0B)[0-9a-fA-F\_]+|\d*[\.\_]?[\d\_]+(?:[eE][\-\+]\d+)?[lLuU]* ]]
    6 
    7 Keywords={
    8   { Id=1,
    9     List={  "break", "continue", "del", "except", "exec", "finally", "pass",
   10             "print", "raise", "return", "try", "global", "assert", "lambda", "yield", "def",
   11             "class", "for", "while", "if", "elif", "else", "and", "in", "is", "not", "or",
   12             "import", "from", "as", "async", "await", "None", "True", "False"}
   13   },
   14   { Id=2,
   15     List={  "bool", "bytes", "enumerate", "set", "frozenset", "help", "reversed", "sorted",
   16             "sum", "Ellipsis", "NotImplemented", "__import__", "abs", "apply", "buffer",
   17             "callable", "chr", "classmethod", "cmp", "coerce", "compile", "complex",
   18             "delattr", "dict", "dir", "divmod", "eval", "execfile", "file", "filter",
   19             "float", "getattr", "globals", "hasattr", "hash", "hex", "id", "input", "int",
   20             "intern", "isinstance", "issubclass", "iter", "len", "list", "locals", "long",
   21             "map", "max", "min", "object", "oct", "open", "ord", "pow", "property", "range",
   22             "raw_input", "reduce", "reload", "repr", "round", "setattr", "slice",
   23             "staticmethod", "str", "super", "tuple", "type", "unichr", "unicode", "vars",
   24             "xrange", "zip"}
   25   },
   26   -- decorators:
   27   { Id=2,
   28     Regex=[[@[\w\.]+]],
   29   },
   30   { Id=3,
   31     List={  "ArithmeticError", "AssertionError", "AttributeError",
   32             "DeprecationWarning", "EOFError", "EnvironmentError", "Exception",
   33             "FloatingPointError", "IOError", "ImportError", "IndentationError",
   34             "IndexError", "KeyError", "KeyboardInterrupt", "LookupError", "MemoryError",
   35             "NameError", "NotImplementedError", "OSError", "OverflowError",
   36             "OverflowWarning", "ReferenceError", "RuntimeError", "RuntimeWarning",
   37             "StandardError", "StopIteration", "SyntaxError", "SyntaxWarning", "SystemError",
   38             "SystemExit", "TabError", "TypeError", "UnboundLocalError", "UnicodeError",
   39             "UnicodeEncodeError", "UnicodeDecodeError", "UnicodeTranslateError",
   40             "UserWarning", "ValueError", "Warning", "WindowsError", "ZeroDivisionError"}
   41   },
   42   { Id=4,
   43     Regex=[[(\w+)\s*\(]],
   44   },
   45 }
   46 
   47 Strings={
   48   Delimiter=[["""|'''|"|']],
   49   RawPrefix="r",
   50   Escape=[=[\\[ntvbrfa\\\?'"]|\\\d{3}|\\x[[:xdigit:]]{2}]=],
   51   Interpolation=[[ %[%#0\-\+diouxXeEfFgGcrs]+|%\(\w+\)[sd]?|\{\w+\} ]]
   52 }
   53 
   54 IgnoreCase=false
   55 
   56 Comments={
   57   { Block=false,
   58     Delimiter= { [[#]] },
   59   },
   60 }
   61 
   62 Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\.|\:|\&|<|>|\!|\=|\/|\*|\%|\+|\-|\@]]
   63 
   64 
   65 function OnStateChange(oldState, newState, token, groupID)
   66   if oldState==HL_STANDARD and string.sub(token,1,1)=="%" then
   67     return HL_OPERATOR
   68   end
   69 
   70   return newState
   71 end
   72