text/js/highlight/python.js.map

1 строка
10 KiB
Plaintext
Исходник Постоянная ссылка Ответственный История

Этот файл содержит неоднозначные символы Юникода!

Этот файл содержит неоднозначные символы Юникода, которые могут быть перепутаны с другими в текущей локали. Если это намеренно, можете спокойно проигнорировать это предупреждение. Используйте кнопку Экранировать, чтобы подсветить эти символы.

{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/python.js"],"names":["module","exports","hljs","KEYWORDS","keyword","join","built_in","literal","PROMPT","className","begin","SUBST","end","keywords","illegal","LITERAL_BRACKET","relevance","STRING","contains","BACKSLASH_ESCAPE","variants","APOS_STRING_MODE","QUOTE_STRING_MODE","digitpart","pointfloat","NUMBER","PARAMS","skip","excludeBegin","excludeEnd","HASH_COMMENT_MODE","name","aliases","beginKeywords","UNDERSCORE_TITLE_MODE","endsWithParent"],"mappings":"oGAgSAA,EAAOC,QAzRP,SAAgBC,GACd,IAqHMC,EAAW,CACfC,QAtHqB,CACrB,MACA,KACA,SACA,QACA,QACA,QACA,QACA,WACA,MACA,MACA,OACA,OACA,SACA,UACA,MACA,GACA,OACA,SACA,KACA,SACA,KACA,KACA,SACA,cACA,MACA,KACA,OACA,QACA,SACA,MACA,QACA,OACA,SAqFwBC,KAAK,KAC7BC,SAnFgB,CAChB,aACA,MACA,MACA,MACA,QACA,MACA,OACA,aACA,YACA,QACA,WACA,MACA,cACA,UACA,UACA,UACA,OACA,MACA,SACA,YACA,OACA,OACA,SACA,QACA,SACA,YACA,UACA,UACA,UACA,OACA,OACA,MACA,KACA,QACA,MACA,aACA,aACA,OACA,MACA,OACA,SACA,MACA,MACA,aACA,MACA,OACA,SACA,MACA,OACA,MACA,MACA,QACA,WACA,QACA,OACA,WACA,QACA,MACA,UACA,QACA,SACA,eACA,MACA,MACA,QACA,QACA,OACA,OACA,OAcoBD,KAAK,KACzBE,QAZe,CACf,YACA,WACA,QACA,OACA,iBACA,QAMkBF,KAAK,MAGnBG,EAAS,CACbC,UAAW,OAASC,MAAO,kBAGv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OAAF,OAASa,EAAT,eAILG,EAAS,CACbjB,UAAW,SACXW,SAAU,CAER,CAACV,MAAO,UAAWiB,MAAM,EAAMlB,UAAW,MAC1C,CACEC,MAAO,KAAME,IAAK,KAAMgB,cAAc,EAAMC,YAAY,EACxDhB,SAAUV,EACVe,SAAU,CAAC,OAAQV,EAAQiB,EAAQR,EAAQf,EAAK4B,sBAMtD,OAFAnB,EAAMO,SAAW,CAACD,EAAQQ,EAAQjB,GAE3B,CACLuB,KAAM,SACNC,QAAS,CAAC,KAAM,MAAO,WACvBnB,SAAUV,EACVW,QAAS,iBACTI,SAAU,CACRV,EACAiB,EAGA,CAAEf,MAAO,YACT,CAAEuB,cAAe,KAAMjB,UAAW,GAClCC,EACAf,EAAK4B,kBACL,CACEV,SAAU,CACR,CAACX,UAAW,WAAYwB,cAAe,OACvC,CAACxB,UAAW,QAASwB,cAAe,UAEtCrB,IAAK,IACLE,QAAS,YACTI,SAAU,CACRhB,EAAKgC,sBACLR,EACA,CACEhB,MAAO,KAAMyB,gBAAgB,EAC7BtB,SAAU,UAIhB,CACEJ,UAAW,OACXC,MAAO,WAAYE,IAAK,UACxBM,SAAU,CAACO,EAAQC,EAAQT,IAE7B,CACEP,MAAO","file":"highlight/python.js?v=e3093c096ca3fc275c6b","sourcesContent":["/*\nLanguage: Python\nDescription: Python is an interpreted, object-oriented, high-level programming language with dynamic semantics.\nWebsite: https://www.python.org\nCategory: common\n*/\n\nfunction python(hljs) {\n const RESERVED_WORDS = [\n 'and',\n 'as',\n 'assert',\n 'async',\n 'await',\n 'break',\n 'class',\n 'continue',\n 'def',\n 'del',\n 'elif',\n 'else',\n 'except',\n 'finally',\n 'for',\n '',\n 'from',\n 'global',\n 'if',\n 'import',\n 'in',\n 'is',\n 'lambda',\n 'nonlocal|10',\n 'not',\n 'or',\n 'pass',\n 'raise',\n 'return',\n 'try',\n 'while',\n 'with',\n 'yield',\n ];\n\n const BUILT_INS = [\n '__import__',\n 'abs',\n 'all',\n 'any',\n 'ascii',\n 'bin',\n 'bool',\n 'breakpoint',\n 'bytearray',\n 'bytes',\n 'callable',\n 'chr',\n 'classmethod',\n 'compile',\n 'complex',\n 'delattr',\n 'dict',\n 'dir',\n 'divmod',\n 'enumerate',\n 'eval',\n 'exec',\n 'filter',\n 'float',\n 'format',\n 'frozenset',\n 'getattr',\n 'globals',\n 'hasattr',\n 'hash',\n 'help',\n 'hex',\n 'id',\n 'input',\n 'int',\n 'isinstance',\n 'issubclass',\n 'iter',\n 'len',\n 'list',\n 'locals',\n 'map',\n 'max',\n 'memoryview',\n 'min',\n 'next',\n 'object',\n 'oct',\n 'open',\n 'ord',\n 'pow',\n 'print',\n 'property',\n 'range',\n 'repr',\n 'reversed',\n 'round',\n 'set',\n 'setattr',\n 'slice',\n 'sorted',\n 'staticmethod',\n 'str',\n 'sum',\n 'super',\n 'tuple',\n 'type',\n 'vars',\n 'zip',\n ];\n\n const LITERALS = [\n '__debug__',\n 'Ellipsis',\n 'False',\n 'None',\n 'NotImplemented',\n 'True',\n ];\n\n const KEYWORDS = {\n keyword: RESERVED_WORDS.join(' '),\n built_in: BUILT_INS.join(' '),\n literal: LITERALS.join(' ')\n };\n\n const PROMPT = {\n className: 'meta', begin: /^(>>>|\\.\\.\\.) /\n };\n\n const SUBST = {\n className: 'subst',\n begin: /\\{/, end: /\\}/,\n keywords: KEYWORDS,\n illegal: /#/\n };\n\n const LITERAL_BRACKET = {\n begin: /\\{\\{/,\n relevance: 0\n };\n\n const STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE],\n variants: [\n {\n begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/, end: /'''/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT],\n relevance: 10\n },\n {\n begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?\"\"\"/, end: /\"\"\"/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT],\n relevance: 10\n },\n {\n begin: /([fF][rR]|[rR][fF]|[fF])'''/, end: /'''/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST]\n },\n {\n begin: /([fF][rR]|[rR][fF]|[fF])\"\"\"/, end: /\"\"\"/,\n contains: [hljs.BACKSLASH_ESCAPE, PROMPT, LITERAL_BRACKET, SUBST]\n },\n {\n begin: /([uU]|[rR])'/, end: /'/,\n relevance: 10\n },\n {\n begin: /([uU]|[rR])\"/, end: /\"/,\n relevance: 10\n },\n {\n begin: /([bB]|[bB][rR]|[rR][bB])'/, end: /'/\n },\n {\n begin: /([bB]|[bB][rR]|[rR][bB])\"/, end: /\"/\n },\n {\n begin: /([fF][rR]|[rR][fF]|[fF])'/, end: /'/,\n contains: [hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST]\n },\n {\n begin: /([fF][rR]|[rR][fF]|[fF])\"/, end: /\"/,\n contains: [hljs.BACKSLASH_ESCAPE, LITERAL_BRACKET, SUBST]\n },\n hljs.APOS_STRING_MODE,\n hljs.QUOTE_STRING_MODE\n ]\n };\n\n // https://docs.python.org/3.9/reference/lexical_analysis.html#numeric-literals\n const digitpart = '[0-9](_?[0-9])*';\n const pointfloat = `(\\\\b(${digitpart}))?\\\\.(${digitpart})|\\\\b(${digitpart})\\\\.`;\n const NUMBER = {\n className: 'number', relevance: 0,\n variants: [\n // exponentfloat, pointfloat\n // https://docs.python.org/3.9/reference/lexical_analysis.html#floating-point-literals\n // optionally imaginary\n // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals\n // Note: no leading \\b because floats can start with a decimal point\n // and we don't want to mishandle e.g. `fn(.5)`,\n // no trailing \\b for pointfloat because it can end with a decimal point\n // and we don't want to mishandle e.g. `0..hex()`; this should be safe\n // because both MUST contain a decimal point and so cannot be confused with\n // the interior part of an identifier\n { begin: `(\\\\b(${digitpart})|(${pointfloat}))[eE][+-]?(${digitpart})[jJ]?\\\\b` },\n { begin: `(${pointfloat})[jJ]?` },\n\n // decinteger, bininteger, octinteger, hexinteger\n // https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals\n // optionally \"long\" in Python 2\n // https://docs.python.org/2.7/reference/lexical_analysis.html#integer-and-long-integer-literals\n // decinteger is optionally imaginary\n // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals\n { begin: '\\\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?\\\\b' },\n { begin: '\\\\b0[bB](_?[01])+[lL]?\\\\b' },\n { begin: '\\\\b0[oO](_?[0-7])+[lL]?\\\\b' },\n { begin: '\\\\b0[xX](_?[0-9a-fA-F])+[lL]?\\\\b' },\n\n // imagnumber (digitpart-based)\n // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals\n { begin: `\\\\b(${digitpart})[jJ]\\\\b` },\n ]\n };\n\n const PARAMS = {\n className: 'params',\n variants: [\n // Exclude params at functions without params\n {begin: /\\(\\s*\\)/, skip: true, className: null },\n {\n begin: /\\(/, end: /\\)/, excludeBegin: true, excludeEnd: true,\n keywords: KEYWORDS,\n contains: ['self', PROMPT, NUMBER, STRING, hljs.HASH_COMMENT_MODE],\n },\n ],\n };\n SUBST.contains = [STRING, NUMBER, PROMPT];\n\n return {\n name: 'Python',\n aliases: ['py', 'gyp', 'ipython'],\n keywords: KEYWORDS,\n illegal: /(<\\/|->|\\?)|=>/,\n contains: [\n PROMPT,\n NUMBER,\n // eat \"if\" prior to string so that it won't accidentally be\n // labeled as an f-string as in:\n { begin: /\\bself\\b/, }, // very common convention\n { beginKeywords: \"if\", relevance: 0 },\n STRING,\n hljs.HASH_COMMENT_MODE,\n {\n variants: [\n {className: 'function', beginKeywords: 'def'},\n {className: 'class', beginKeywords: 'class'}\n ],\n end: /:/,\n illegal: /[${=;\\n,]/,\n contains: [\n hljs.UNDERSCORE_TITLE_MODE,\n PARAMS,\n {\n begin: /->/, endsWithParent: true,\n keywords: 'None'\n }\n ]\n },\n {\n className: 'meta',\n begin: /^[\\t ]*@/, end: /(?=#)|$/,\n contains: [NUMBER, PARAMS, STRING]\n },\n {\n begin: /\\b(print|exec)\\(/ // dont highlight keywords-turned-functions in Python 3\n }\n ]\n };\n}\n\nmodule.exports = python;\n"],"sourceRoot":""}