diff --git a/cmd/micro/runtime.go b/cmd/micro/runtime.go index 73b88d92..792d7274 100644 --- a/cmd/micro/runtime.go +++ b/cmd/micro/runtime.go @@ -91,6 +91,7 @@ // runtime/syntax/privoxy-filter.micro // runtime/syntax/puppet.micro // runtime/syntax/python2.micro +// runtime/syntax/python3.micro // runtime/syntax/r.micro // runtime/syntax/reST.micro // runtime/syntax/rpmspec.micro @@ -2000,6 +2001,26 @@ func runtimeSyntaxPython2Micro() (*asset, error) { return a, nil } +var _runtimeSyntaxPython3Micro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x7c\x56\x6d\x73\x1b\xb9\x0d\xfe\xee\x5f\xb1\xb7\x4a\x2b\xdb\xa9\x9d\xce\xf4\x53\x5f\xae\xbd\xb7\x78\x9a\x69\x5e\x6e\xea\xb4\x9d\x39\xdb\xa7\xe1\x92\x58\x2d\x4e\x5c\x92\x03\x72\x25\x6d\x8a\xfe\xf7\x0e\x48\xae\xa2\xf4\x72\xfd\xa0\xc5\x43\x0a\x04\xc1\x87\x00\x88\xd5\xaa\xf9\x2b\x10\x34\x18\x1b\xe5\x1a\x38\xaa\x31\x58\x68\x7a\x4f\xcd\xf7\x73\x1a\xbc\xbb\xbd\x58\xad\x2e\xe2\xec\x92\x3a\x36\x6d\xc8\x53\xbf\x6b\x9b\xf6\xf1\x36\xcc\xcf\xda\x8b\x01\x94\x01\x6a\xda\x1f\x57\x5f\xdc\x5e\xbf\xb8\x04\xb7\x6f\x9e\x5f\xfd\xa5\xaa\x3d\x6b\x2f\x2e\x56\xab\xa6\x9b\xd0\xa6\x1b\x74\x8d\xef\x7e\x02\x9d\xe2\x85\xf6\xd6\x53\xa3\xbd\x8b\x49\xb9\xd4\xb4\x8f\xdd\xe5\x5b\xef\x80\x23\xd8\x9e\xdf\xd3\x04\x7c\xa7\x6c\x84\xab\xc7\xae\xfd\x64\xbd\x4a\x89\xb0\x9b\x12\x7c\xd6\xc4\x66\xd3\xa9\x08\x71\xb3\xe1\xcd\x26\x2f\x41\x97\xb1\xb6\x2a\x96\x59\x03\xdd\xb4\x2d\x08\x75\x2a\xc0\xeb\x2c\x7b\xb4\x90\xc1\x08\x63\x07\x14\x2b\x4e\x83\x37\x05\x3b\x35\x16\x05\x71\x72\xb3\xf9\x99\x6f\xfd\xe4\x74\x42\xef\x16\xd7\xd0\x80\x4b\xd8\xa3\x90\xf3\xd8\x5d\xaa\x2e\xb2\xb2\x96\x95\x9b\x59\x45\x8d\xc8\x1d\x3a\xd6\xca\x5a\xd5\x59\x60\x3d\x10\x6b\x3f\x06\xb4\xc0\x06\xac\x1c\x94\x0d\xca\x6f\x3f\x7a\xc3\xb0\x57\x96\xe1\x08\x9a\x7b\x4f\xa3\x4a\xbc\x85\x94\x75\xb6\xd6\x77\xca\x46\x1e\x54\xcc\xe3\x41\xc5\x81\x07\xb0\x81\x07\x38\x32\x1a\x46\x17\xa6\xc4\x18\x31\x13\xa5\x81\x31\xc6\xa9\xcb\x94\x30\x26\x20\xb6\xe0\xd8\x7a\x2d\x46\x46\x75\xe4\x11\x1d\x3b\x38\x26\xf6\x3a\xb1\x0f\xe0\xd8\x93\xe1\xe0\x0f\x1c\x08\x5d\x62\x82\x40\x4c\x7e\x72\x86\x63\xf5\x21\x7a\x4a\x60\x38\x4e\x23\xef\x15\x45\xde\x6c\x70\x0c\x9e\xd2\x47\x92\xa2\x1f\xa1\x91\xfd\x8d\x22\xd3\x58\xec\x48\xd1\xdc\x54\x76\x9b\x17\xe7\xf7\xba\xfa\x3c\x7b\x21\x80\x33\xac\x2d\x28\x62\x6d\x7d\x84\xf2\x35\xac\x3d\x90\x06\xd6\xde\xfd\x34\x6d\x55\x12\x14\x66\xd6\x7e\x72\x89\xe1\x98\x64\x95\x5c\xad\xf3\xdc\xdb\x29\x0e\x42\x9c\x90\xb4\xd9\xc1\xcc\xe8\x8c\x90\xe4\x22\x50\x12\x32\xc6\xc8\x04\xca\xe4\x8f\x45\x07\x27\x10\x19\x85\xde\x99\x77\x30\x47\x1e\xbd\x01\x96\x70\xe0\xe0\x03\x13\x8c\x7e\x2f\xaa\x7b\xa0\x28\x21\x0c\x3b\x8e\xbe\x4f\x31\x28\x0d\x99\x1b\x4e\x60\x2d\x27\x9a\x9c\x16\x07\x0f\x84\xcb\xb7\xd8\x9e\x82\x91\xf9\xbd\xb2\x13\xc4\x13\x65\x01\x34\x2a\x5b\x49\x6a\x64\xbb\x5f\x88\xac\xcd\x46\x75\x25\x44\x95\x31\x45\xba\x22\x25\xba\x0a\x18\x43\x91\x99\xac\x0a\x25\xcd\x8f\x15\x8b\x67\x0b\x4c\x0a\xdd\x92\x2e\x76\x91\x72\x43\x0b\x16\xa6\x16\x1c\x2d\x56\x83\x06\xf7\x8b\x1c\x7d\xd9\xbf\xb7\xbe\x9a\xad\xe1\xba\xe0\x93\x85\x2d\xa4\x8f\x16\x24\x76\x0b\xa8\x7e\xa1\xc3\x54\xc1\x22\xf7\x8b\x04\x2a\x53\x16\xdc\xa7\x09\x6d\xbd\x2b\x29\x6e\xe3\x80\x7d\x99\x5b\x1c\x1a\xa7\x72\x20\x07\xdb\x2a\x8f\x45\xc1\x79\xf7\x01\xc8\x67\xec\xab\x21\x5f\xdc\x0d\x3e\x56\x79\xc8\x92\x16\x96\x69\xa1\x99\x16\x7a\x69\xe1\x80\xce\x48\x20\x08\x50\x59\x90\xdc\x29\xe0\xcc\x37\x3a\x29\x2e\xde\x51\xdd\x99\x4e\x5b\xd2\x99\xfa\x39\x9c\xba\x02\x8e\x75\x45\x3c\xa3\x39\x9e\xd1\x1c\xcf\x69\x8e\x8b\x42\x5d\x9d\x17\x2f\x61\x07\x47\x0d\x41\xca\x58\x93\x4b\x84\x24\x64\x53\x4b\xed\xac\x5c\x8e\xb7\x97\x8b\x0a\xdf\xd7\x8c\x7e\x49\xe4\x89\xbf\x26\x4c\xc3\x08\x09\x75\x19\xbf\xf6\x7e\x37\x85\x82\x5f\xba\x3d\x92\x77\x23\xb8\x54\x95\xa3\x24\x1d\x7a\x57\x87\x4b\x01\xa8\xea\xef\xee\x0a\xb8\x93\x08\x42\xb7\xfd\xde\xe3\xb2\xf2\xd5\xbb\x2a\x73\x8d\xa9\x58\x12\xb9\xc0\xbf\xc1\x7c\x02\x9d\x57\x64\x5e\xb9\x04\x44\x53\x48\xfc\x06\x46\x4f\xf5\xdf\xb7\x6a\xac\x7b\xbd\xf5\xe9\x95\xa4\x82\xf8\x06\xf5\x28\xef\xee\xab\xdc\x03\xf5\xd6\x1f\xca\xe8\xef\x93\x4b\xb8\x2c\xbb\xcf\x0f\xe2\x82\x63\x82\xf1\x13\x7c\xc4\xc4\xef\xe7\x50\x95\xff\xe1\x3a\xa9\x98\xaf\xa5\xcc\x2e\x33\xa8\xbd\xa9\x7f\xff\x53\x32\xbf\xc0\x7f\xa1\x33\xfe\x10\xcb\xe0\x07\x20\xff\x1d\xee\x31\x2e\x3c\x2d\xb7\x94\xe6\x70\xaa\x06\x82\xf3\xbd\x74\xde\x5b\xee\xe6\x04\x8a\x48\xcd\x19\x45\xce\xb7\x58\x6a\x08\xd7\x94\x67\x49\x15\x06\x37\x8d\x40\x52\x77\x7a\xb4\xf2\x0e\xe4\x64\xe5\x9e\xfc\x07\x70\x11\x12\x4b\xb1\xb7\x18\x13\x8f\x2a\xf0\x98\xa9\xdb\x23\x1c\xb8\xbc\xe1\x1c\xc8\x07\xa0\x34\x33\x29\xb7\x3d\x95\xbf\xfc\x28\x70\x8e\x35\x8e\x49\x25\xd4\x75\xef\x28\xef\xc4\x14\x80\x38\x4d\xc1\x02\x8b\xd7\xfc\x01\xc3\x55\xbb\x54\xfc\xd3\x39\xa4\x13\x10\xea\x32\x7f\x19\xbc\x72\x29\xcb\xd7\xde\x6d\x33\xc8\x61\x91\xd1\xb7\xe5\x4c\x19\xdf\x27\xc2\xaa\x50\xe9\xcd\xf8\x9b\xa9\xef\x81\x8a\x45\xd9\xbb\x98\xc2\x58\x0c\x7c\x87\xba\x80\xbb\xfa\x7e\x97\xbf\xd5\xd8\x19\x55\x77\xa8\x76\xbe\x15\x2a\xab\xf5\x7c\x9d\x6f\xf2\xd1\xaa\x87\xe5\x75\xcd\x83\xb3\xf9\x6f\x4a\x1b\xf2\x89\xed\x3a\x77\xa6\xf5\xc6\x9b\xa9\xfa\x75\x87\x15\xbc\x27\xa5\xa1\x53\x7a\x57\xa6\x49\x8d\x65\xfe\x5e\xb8\xcd\xe8\xa5\xb5\x18\x22\x66\x97\x96\xc0\x30\xd0\x4b\xd1\xfc\x85\x36\xc4\x40\xdf\x3c\xa8\x9b\x0f\x5f\xdf\xfc\xb0\xf9\xed\xcd\xef\x9f\x9e\xb7\x8d\x2c\xda\xc1\x7c\xf0\x64\x96\x15\x72\x6f\x39\x1b\xca\xcb\xeb\x0c\xab\xc8\x2a\xe7\x2b\x77\x04\x6a\x57\x82\x4a\x9e\xdc\x84\x6e\x92\x7e\xa5\x97\x9e\x85\xc1\x62\xcf\x60\x23\x70\xa9\x22\xdc\xa3\x53\xd6\xce\xd2\xb3\x48\x60\x8d\xb5\x5b\x61\xec\xb9\x74\x08\x8c\x8e\x31\xb2\xcd\x6c\xb3\xf3\x2e\x37\x22\xec\x7c\x62\x4f\x1c\x64\x17\x52\x18\x25\xbc\xd2\x44\x8e\x13\xcd\x7c\x18\xa4\x47\x3a\x60\x1a\x78\x46\xb0\x46\x8e\xde\x5c\x94\xc3\x6b\x4f\x2a\x79\x5a\x4e\xd2\x11\x6e\x87\xb4\x25\x00\xd7\xb4\x5f\xdd\x5e\x3f\x5c\x3e\x95\x86\x54\x42\xf7\x5c\xf1\xec\xc8\x0f\xb7\x7f\xf8\xe3\x6f\x9e\x5f\xf3\x97\x5f\x3c\xfe\xea\xab\xa7\xb6\x69\xff\xd4\x36\xed\x9f\xdb\xa6\x7d\xd1\x36\xed\x4d\xdb\xb4\xbf\x2e\x26\x82\x22\x70\x69\x80\x08\x9f\x33\x72\x79\xf5\xef\xff\xc8\xe2\xc7\x07\xf9\xd4\x5d\xdd\x94\x3b\xcb\xff\x69\x5d\x6f\xcb\xb4\x90\xfd\x90\x2f\x45\xae\x32\x77\x00\x39\x9c\x7f\xa6\x5e\xa6\x9b\xb6\xbd\x7c\x7c\xbc\xe5\x87\x1f\xdb\xa7\xab\xeb\x96\xd7\x75\xb4\x7e\xba\xba\x5e\xd7\xae\x3b\x9f\xbe\xb3\x4a\xef\x3e\x1a\x19\x8b\x83\xab\xdb\xeb\xa5\x37\xb7\x5e\xef\xfe\x9f\x6e\x4c\x8a\xd2\x97\x6d\xdb\xb6\x97\xb2\x19\x3f\xbb\x6a\x1b\x70\x26\xcf\xb4\x9f\xd7\x5d\xaf\xd7\x97\xe2\xca\x47\xdd\xf5\x7a\xdd\x5e\xfc\x37\x00\x00\xff\xff\x11\xf5\x83\x29\x69\x0c\x00\x00") + +func runtimeSyntaxPython3MicroBytes() ([]byte, error) { + return bindataRead( + _runtimeSyntaxPython3Micro, + "runtime/syntax/python3.micro", + ) +} + +func runtimeSyntaxPython3Micro() (*asset, error) { + bytes, err := runtimeSyntaxPython3MicroBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "runtime/syntax/python3.micro", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + var _runtimeSyntaxRMicro = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x54\xce\xb1\x6a\xc3\x40\x0c\xc6\xf1\xfd\x9e\xe2\xb8\x64\x48\x3a\xe4\x1d\x3c\xa4\x50\x30\x37\xb8\xcd\x66\x30\xf2\x55\x6e\x8e\x9e\xa5\xa0\x93\xa9\x0b\x7a\xf8\x92\xc6\x4b\x26\xfd\xa6\xbf\xbe\x9d\xef\x7c\xe5\x45\x12\xfa\xc4\x9f\xe8\x5c\xfd\x25\x85\xd5\x07\x09\x3e\xf4\xa7\x83\x58\x77\xdc\x07\xe7\x12\x17\x16\x5f\x15\x14\x67\x24\xf5\xa1\x1f\x0f\xa3\x20\x7c\x1b\x96\x8a\x36\xb1\xd8\xb4\x50\xd2\xcc\x64\x79\xb2\x4c\x46\xb8\xaa\x09\xde\x10\xee\x47\x17\x21\xfb\xb9\xe6\x82\xc7\x7e\x0c\x5b\x2e\x31\x55\x85\xad\xf6\xd1\x5d\xce\xf6\xda\xb4\xef\x67\x8b\x97\xb6\xb5\x37\x9a\x2c\x42\xb4\xd8\x58\x6c\x86\x4c\x8a\x5f\x28\xc3\xdd\x82\x50\xfe\x91\x78\xbe\x15\x5c\x1f\xbe\x82\x40\x52\x94\xe1\xe9\xc1\xfc\x58\xbb\x3b\xbd\xec\x83\x77\x7f\x01\x00\x00\xff\xff\xd2\xcf\x96\x95\xee\x00\x00\x00") func runtimeSyntaxRMicroBytes() ([]byte, error) { @@ -2583,6 +2604,7 @@ var _bindata = map[string]func() (*asset, error){ "runtime/syntax/privoxy-filter.micro": runtimeSyntaxPrivoxyFilterMicro, "runtime/syntax/puppet.micro": runtimeSyntaxPuppetMicro, "runtime/syntax/python2.micro": runtimeSyntaxPython2Micro, + "runtime/syntax/python3.micro": runtimeSyntaxPython3Micro, "runtime/syntax/r.micro": runtimeSyntaxRMicro, "runtime/syntax/reST.micro": runtimeSyntaxRestMicro, "runtime/syntax/rpmspec.micro": runtimeSyntaxRpmspecMicro, @@ -2750,6 +2772,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "privoxy-filter.micro": &bintree{runtimeSyntaxPrivoxyFilterMicro, map[string]*bintree{}}, "puppet.micro": &bintree{runtimeSyntaxPuppetMicro, map[string]*bintree{}}, "python2.micro": &bintree{runtimeSyntaxPython2Micro, map[string]*bintree{}}, + "python3.micro": &bintree{runtimeSyntaxPython3Micro, map[string]*bintree{}}, "r.micro": &bintree{runtimeSyntaxRMicro, map[string]*bintree{}}, "reST.micro": &bintree{runtimeSyntaxRestMicro, map[string]*bintree{}}, "rpmspec.micro": &bintree{runtimeSyntaxRpmspecMicro, map[string]*bintree{}}, diff --git a/runtime/syntax/python3.micro b/runtime/syntax/python3.micro new file mode 100644 index 00000000..39e45ba3 --- /dev/null +++ b/runtime/syntax/python3.micro @@ -0,0 +1,46 @@ +## Here is an example for Python. +## +syntax "python3" "\.py$" +header "^#!.*/(env +)?python3$" + +## built-in objects +color constant "\b(None|self|True|False)\b" +## built-in attributes +color constant "\b(__bases__|__builtin__|__class__|__debug__|__dict__|__doc__|__file__|__members__|__methods__|__name__|__self__)\b" +## built-in functions +color identifier "\b(abs|all|any|ascii|bin|callable|chr|compile|delattr|dir|divmod|eval|exec|format|getattr|globals|hasattr|hash|help|hex|id|input|isinstance|issubclass|iter|len|locals|max|min|next|oct|open|ord|pow|print|repr|round|setattr|sorted|sum|vars|__import__)\b" +## some standard library methods / attributes +#color identifier "\b(append|clear|close|closed|coerce|conjugate|copy|count|extend|fileno|flush|get|has_key|index|insert|items|read|readline|readlines|isatty|keys|mode|name|pop|remove|reverse|seek|softspace|sort|tell|truncate|write|writelines|update|values)\b" +## special method names +color identifier "\b(__abs__|__add__|__and__|__call__|__cmp__|__coerce__|__complex__|__concat__|__contains__|__del__|__delattr__|__delitem__|__delslice__|__div__|__divmod__|__float__|__getattr__|__getitem__|__getslice__|__hash__|__hex__|__init__|__int__|__inv__|__invert__|__len__|__dict__|__long__|__lshift__|__mod__|__mul__|__neg__|__next__|__nonzero__|__oct__|__or__|__pos__|__pow__|__radd__|__rand__|__rcmp__|__rdiv__|__rdivmod__|__repeat__|__repr__|__rlshift__|__rmod__|__rmul__|__ror__|__rpow__|__rrshift__|__rshift__|__rsub__|__rxor__|__setattr__|__setitem__|__setslice__|__str__|__sub__|__xor__)\b" +## exception classes +# color cyan "\b(Exception|StandardError|ArithmeticError|LookupError|EnvironmentError|AssertionError|AttributeError|EOFError|FloatingPointError|IOError|ImportError|IndexError|KeyError|KeyboardInterrupt|MemoryError|NameError|NotImplementedError|OSError|OverflowError|RuntimeError|SyntaxError|SystemError|SystemExit|TypeError|UnboundLocalError|UnicodeError|ValueError|WindowsError|ZeroDivisionError)\b" +## types +color type "\b(bool|bytearray|bytes|classmethod|complex|dict|enumerate|filter|float|frozenset|int|list|map|memoryview|object|property|range|reversed|set|slice|staticmethod|str|super|tuple|type|zip)" +#color type "\b(NoneType|TypeType|IntType|LongType|FloatType|ComplexType|StringType|UnicodeType|BufferType|TupleType|ListType|DictType|FunctionType|LambdaType|CodeType|ClassType|UnboundMethodType|InstanceType|MethodType|BuiltinFunctionType|BuiltinMethodType|ModuleType|FileType|TracebackType|FrameType|SliceType|EllipsisType)\b" +## definitions +color identifier "def [a-zA-Z_0-9]+" +## keywords +color statement "\b(and|as|assert|break|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|raise|return|try|while|with|yield)\b" + +## decorators +color brightgreen "@.*[(]" + +## operators +color statement "[.:;,+*|=!\%@]" "<" ">" "/" "-" "&" + +## parentheses +color statement "[(){}]" "\[" "\]" + +## numbers +color constant.number "\b[0-9]+\b" + +## strings +color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'" + +## brightblacks +color comment "#.*$" + +## block brightblacks +color comment start=""""([^"]|$)" end=""""" +color comment start="'''([^']|$)" end="'''"