1
|
{"version":3,"sources":["webpack:///./node_modules/highlight.js/lib/languages/ruby.js"],"names":["module","exports","hljs","RUBY_METHOD_RE","RUBY_KEYWORDS","keyword","literal","YARDOCTAG","className","begin","IRB_OBJECT","end","COMMENT_MODES","COMMENT","contains","relevance","SUBST","keywords","STRING","BACKSLASH_ESCAPE","variants","returnBegin","endSameAsBegin","PARAMS","endsParent","RUBY_DEFAULT_CONTAINS","beginKeywords","illegal","inherit","TITLE_MODE","IDENT_RE","concat","UNDERSCORE_IDENT_RE","RE_STARTERS_RE","IRB_DEFAULT","starts","aliases"],"mappings":"qFAAAA,EAAOC,QAAU,SAASC,GACxB,IAAIC,EAAiB,qFACjBC,EAAgB,CAClBC,QACE,8OAGFC,QACE,kBAEAC,EAAY,CACdC,UAAW,SACXC,MAAO,cAELC,EAAa,CACfD,MAAO,KAAME,IAAK,KAEhBC,EAAgB,CAClBV,EAAKW,QACH,IACA,IACA,CACEC,SAAU,CAACP,KAGfL,EAAKW,QACH,YACA,UACA,CACEC,SAAU,CAACP,GACXQ,UAAW,KAGfb,EAAKW,QAAQ,WAAY,SAEvBG,EAAQ,CACVR,UAAW,QACXC,MAAO,OAAQE,IAAK,IACpBM,SAAUb,GAERc,EAAS,CACXV,UAAW,SACXM,SAAU,CAACZ,EAAKiB,iBAAkBH,GAClCI,SAAU,CACR,CAACX,MAAO,IAAKE,IAAK,KAClB,CAACF,MAAO,IAAKE,IAAK,KAClB,CAACF,MAAO,IAAKE,IAAK,KAClB,CAACF,MAAO,eAAgBE,IAAK,OAC7B,CAACF,MAAO,eAAgBE,IAAK,OAC7B,CAACF,MAAO,aAAcE,IAAK,KAC3B,CAACF,MAAO,aAAcE,IAAK,KAC3B,CAACF,MAAO,aAAcE,IAAK,KAC3B,CAACF,MAAO,aAAcE,IAAK,KAC3B,CAACF,MAAO,aAAcE,IAAK,KAC3B,CAACF,MAAO,eAAgBE,IAAK,OAC7B,CAGEF,MAAO,iEAET,CACEA,MAAO,oCACPY,aAAa,EAC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,EAAMF,SAAWW,EACjBF,EAAOT,SAAWW,EAElB,IAIIS,EAAc,CAChB,CACEzB,MAAO,SACP0B,OAAQ,CACNxB,IAAK,IAAKG,SAAUW,IAGxB,CACEjB,UAAW,OACXC,MAAO,gFACP0B,OAAQ,CACNxB,IAAK,IAAKG,SAAUW,KAK1B,MAAO,CACLW,QAAS,CAAC,KAAM,UAAW,UAAW,OAAQ,OAC9CnB,SAAUb,EACVuB,QAAS,OACTb,SAAUF,EAAcmB,OAAOG,GAAaH,OAAON","file":"highlight/ruby.js?v=1a5e9c406c37a93bb680","sourcesContent":["module.exports = function(hljs) {\n var RUBY_METHOD_RE = '[a-zA-Z_]\\\\w*[!?=]?|[-+~]\\\\@|<<|>>|=~|===?|<=>|[<>]=?|\\\\*\\\\*|[-/+%^&*~`|]|\\\\[\\\\]=?';\n var RUBY_KEYWORDS = {\n keyword:\n 'and then defined module in return redo if BEGIN retry end for self when ' +\n 'next until do begin unless END rescue else break undef not super class case ' +\n 'require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor',\n literal:\n 'true false nil'\n };\n var YARDOCTAG = {\n className: 'doctag',\n begin: '@[A-Za-z]+'\n };\n var IRB_OBJECT = {\n begin: '#<', end: '>'\n };\n var COMMENT_MODES = [\n hljs.COMMENT(\n '#',\n '$',\n {\n contains: [YARDOCTAG]\n }\n ),\n hljs.COMMENT(\n '^\\\\=begin',\n '^\\\\=end',\n {\n contains: [YARDOCTAG],\n relevance: 10\n }\n ),\n hljs.COMMENT('^__END__', '\\\\n$')\n ];\n var SUBST = {\n className: 'subst',\n begin: '#\\\\{', end: '}',\n keywords: RUBY_KEYWORDS\n };\n var STRING = {\n className: 'string',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n variants: [\n {begin: /'/, end: /'/},\n {begin: /\"/, end: /\"/},\n {begin: /`/, end: /`/},\n {begin: '%[qQwWx]?\\\\(', end: '\\\\)'},\n {begin: '%[qQwWx]?\\\\[', end: '\\\\]'},\n {begin: '%[qQwWx]?{', end: '}'},\n {begin: '%[qQwWx]?<', end: '>'},\n {begin: '%[qQwWx]?/', end: '/'},\n {begin: '%[qQwWx]?%', end: '%'},\n {begin: '%[qQwWx]?-', end: '-'},\n {begin: '%[qQwWx]?\\\\|', end: '\\\\|'},\n {\n // \\B in the beginning suppresses recognition of ?-sequences where ?\n // is the last character of a preceding identifier, as in: `func?4`\n begin: /\\B\\?(\\\\\\d{1,3}|\\\\x[A-Fa-f0-9]{1,2}|\\\\u[A-Fa-f0-9]{4}|\\\\?\\S)\\b/\n },\n { // heredocs\n begin: /<<[-~]?'?(\\w+)(?:.|\\n)*?\\n\\s*\\1\\b/,\n returnBegin: true,\n contains: [\n { begin: /<<[-~]?'?/ },\n { begin: /\\w+/,\n endSameAsBegin: true,\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n }\n ]\n }\n ]\n };\n var PARAMS = {\n className: 'params',\n begin: '\\\\(', end: '\\\\)', endsParent: true,\n keywords: RUBY_KEYWORDS\n };\n\n var RUBY_DEFAULT_CONTAINS = [\n STRING,\n IRB_OBJECT,\n {\n className: 'class',\n beginKeywords: 'class module', end: '$|;',\n illegal: /=/,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: '[A-Za-z_]\\\\w*(::\\\\w+)*(\\\\?|\\\\!)?'}),\n {\n begin: '<\\\\s*',\n contains: [{\n begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE\n }]\n }\n ].concat(COMMENT_MODES)\n },\n {\n className: 'function',\n beginKeywords: 'def', end: '$|;',\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {begin: RUBY_METHOD_RE}),\n PARAMS\n ].concat(COMMENT_MODES)\n },\n {\n // swallow namespace qualifiers before symbols\n begin: hljs.IDENT_RE + '::'\n },\n {\n className: 'symbol',\n begin: hljs.UNDERSCORE_IDENT_RE + '(\\\\!|\\\\?)?:',\n relevance: 0\n },\n {\n className: 'symbol',\n begin: ':(?!\\\\s)',\n contains: [STRING, {begin: RUBY_METHOD_RE}],\n relevance: 0\n },\n {\n className: 'number',\n begin: '(\\\\b0[0-7_]+)|(\\\\b0x[0-9a-fA-F_]+)|(\\\\b[1-9][0-9_]*(\\\\.[0-9_]+)?)|[0_]\\\\b',\n relevance: 0\n },\n {\n begin: '(\\\\$\\\\W)|((\\\\$|\\\\@\\\\@?)(\\\\w+))' // variables\n },\n {\n className: 'params',\n begin: /\\|/, end: /\\|/,\n keywords: RUBY_KEYWORDS\n },\n { // regexp container\n begin: '(' + hljs.RE_STARTERS_RE + '|unless)\\\\s*',\n keywords: 'unless',\n contains: [\n IRB_OBJECT,\n {\n className: 'regexp',\n contains: [hljs.BACKSLASH_ESCAPE, SUBST],\n illegal: /\\n/,\n variants: [\n {begin: '/', end: '/[a-z]*'},\n {begin: '%r{', end: '}[a-z]*'},\n {begin: '%r\\\\(', end: '\\\\)[a-z]*'},\n {begin: '%r!', end: '![a-z]*'},\n {begin: '%r\\\\[', end: '\\\\][a-z]*'}\n ]\n }\n ].concat(COMMENT_MODES),\n relevance: 0\n }\n ].concat(COMMENT_MODES);\n\n SUBST.contains = RUBY_DEFAULT_CONTAINS;\n PARAMS.contains = RUBY_DEFAULT_CONTAINS;\n\n var SIMPLE_PROMPT = \"[>?]>\";\n var DEFAULT_PROMPT = \"[\\\\w#]+\\\\(\\\\w+\\\\):\\\\d+:\\\\d+>\";\n var RVM_PROMPT = \"(\\\\w+-)?\\\\d+\\\\.\\\\d+\\\\.\\\\d(p\\\\d+)?[^>]+>\";\n\n var IRB_DEFAULT = [\n {\n begin: /^\\s*=>/,\n starts: {\n end: '$', contains: RUBY_DEFAULT_CONTAINS\n }\n },\n {\n className: 'meta',\n begin: '^('+SIMPLE_PROMPT+\"|\"+DEFAULT_PROMPT+'|'+RVM_PROMPT+')',\n starts: {\n end: '$', contains: RUBY_DEFAULT_CONTAINS\n }\n }\n ];\n\n return {\n aliases: ['rb', 'gemspec', 'podspec', 'thor', 'irb'],\n keywords: RUBY_KEYWORDS,\n illegal: /\\/\\*/,\n contains: COMMENT_MODES.concat(IRB_DEFAULT).concat(RUBY_DEFAULT_CONTAINS)\n };\n};"],"sourceRoot":""}
|