-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js.map
1 lines (1 loc) · 21 KB
/
index.js.map
1
{"version":3,"file":"index.js","sources":["src/ignore.js","src/join.js","src/csx.js","src/Tree.js","src/index.js"],"sourcesContent":["import homunculus from 'homunculus';\n\nlet ES6Token = homunculus.getClass('token', 'js');\nlet Token = homunculus.getClass('token', 'csx');\nlet Node = homunculus.getClass('node', 'csx');\n\nlet S = {};\nS[Token.LINE] = S[Token.COMMENT] = S[Token.BLANK] = true;\n\nlet res;\nlet append;\n\nfunction ignore(node, includeLine) {\n if(node instanceof Token || node instanceof ES6Token) {\n if(node.isVirtual()) {\n return;\n }\n node.ignore = true;\n append = '';\n while(node = node.next()) {\n if(node.isVirtual() || !S.hasOwnProperty(node.type())) {\n break;\n }\n let s = node.content();\n res += s;\n append += s;\n if(includeLine || s != '\\n') {\n node.ignore = true;\n }\n }\n }\n else if(node.isToken()) {\n ignore(node.token(), includeLine);\n }\n else {\n node.leaves().forEach(function(leaf) {\n ignore(leaf, includeLine);\n });\n }\n}\n\nfunction parse(node, includeLine) {\n res = '';\n append = '';\n ignore(node, includeLine);\n return { res, append };\n}\n\nparse.S = S;\n\nexport default parse;","import homunculus from 'homunculus';\n\nlet JsNode = homunculus.getClass('Node', 'es6');\nlet Token = homunculus.getClass('Token');\n\nexport default function(node, word) {\n let res = recursion(node, { 's': '', 'word': word });\n return res.s;\n};\n\nfunction recursion(node, res) {\n let isToken = node.name() === JsNode.TOKEN;\n let isVirtual = isToken && node.token().type() === Token.VIRTUAL;\n if(isToken) {\n let token = node.token();\n if(!isVirtual) {\n if(res.word && [Token.ID, Token.NUMBER, Token.KEYWORD].indexOf(token.type()) > -1) {\n res.s += ' ';\n }\n if(token.content() === '}' && res.s.charAt(res.s.length - 1) === ';') {\n res.s = res.s.replace(/;$/, '');\n }\n res.s += token.content();\n res.word = [Token.ID, Token.NUMBER, Token.KEYWORD].indexOf(token.type()) > -1;\n }\n else if(token.content() === ';') {\n res.s += ';';\n res.word = false;\n }\n }\n else {\n node.leaves().forEach(function(leaf) {\n recursion(leaf, res);\n });\n }\n return res;\n}","import homunculus from 'homunculus';\nimport Tree from './Tree';\nimport ignore from './ignore';\nimport join from './join';\n\nlet Token = homunculus.getClass('token', 'csx');\nlet Node = homunculus.getClass('node', 'csx');\n\nfunction elem(node) {\n let res = '';\n let tag = selfClose(node.first());\n //open和selfClose逻辑复用\n res += tag.res;\n res += ',[';\n let comma = false;\n for(let i = 1, len = node.size(); i < len - 1; i++) {\n let leaf = node.leaf(i);\n switch(leaf.name()) {\n case Node.CSXChild:\n if(comma) {\n res += ',';\n comma = false;\n }\n res += child(leaf);\n comma = true;\n break;\n case Node.TOKEN:\n let s = leaf.token().content();\n //open和close之间的空白不能忽略\n if(/^\\s+$/.test(s)) {\n if(leaf.prev().name() === Node.CSXOpeningElement && leaf.next().name() === Node.CSXClosingElement) {\n res += '\"' + s.replace(/\"/g, '\\\\\"').replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n\\\\\\n') + '\"';\n }\n else {\n res += s;\n }\n }\n else {\n if(comma) {\n res += ',';\n comma = false;\n }\n res += '\"' + s.replace(/\"/g, '\\\\\"').replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n\\\\\\n') + '\"';\n comma = true;\n }\n break;\n default:\n if(comma) {\n res += ',';\n comma = false;\n }\n res += parse(leaf);\n comma = true;\n }\n }\n res += ']';\n if(tag.isCp && tag.name) {\n res += ',\"' + tag.name + '\"';\n }\n res += ')';\n if(node.last().name() === Node.CSXClosingElement) {\n res += ignore(node.last(), true).res;\n }\n return res;\n}\n\nfunction selfClose(node, isClose) {\n let res = '';\n let name;\n let first = node.leaf(1);\n if(first.isToken()) {\n name = first.token().content();\n }\n else if(first.name() === Node.CSXMemberExpression) {\n name = first.first().token().content();\n for(let i = 1, len = first.size(); i < len; i++) {\n name += first.leaf(i).token().content();\n }\n }\n let isCp = /^[A-Z]/.test(name);\n if(isCp) {\n res += 'karas.createCp(';\n res += name;\n }\n else if(name === '$') {\n res += 'karas.createGm(';\n res += name;\n }\n else if(/^\\$/.test(name)) {\n res += 'karas.createGm(';\n res += '\"' + name + '\"';\n }\n else {\n res += 'karas.createVd(';\n res += '\"' + name + '\"';\n }\n res += ',{';\n for(let i = 2, len = node.size(); i < len - 1; i++) {\n let leaf = node.leaf(i);\n if(i !== 2) {\n res += ',';\n }\n switch(leaf.name()) {\n case Node.CSXBindAttribute:\n res += attr(leaf);\n break;\n case Node.CSXAttribute:\n res += attr(leaf);\n break;\n case Node.CSXSpreadAttribute:\n res += spread(leaf);\n break;\n }\n }\n res += '}';\n if(isClose && isCp) {\n res += ',[],\"' + name + '\"';\n }\n return {\n res,\n isCp,\n name,\n };\n}\n\nfunction attr(node) {\n let res = '';\n let key = node.first().token().content();\n res += '\"' + key + '\":';\n let v = node.last();\n if(v.isToken()) {\n v = v.token().content();\n res += v;\n }\n else {\n res += child(v);\n }\n return res;\n}\n\nfunction spread(node) {\n return join(node.leaf(2));\n}\n\nfunction child(node) {\n return new Tree().parse(node).replace(/^(\\s*){/, '$1').replace(/}(\\s*)$/, '$1');\n}\n\nfunction fragment(node) {\n let res = 'karas.Fragment([';\n let comma = false;\n for(let i = 2, len = node.size(); i < len - 2; i++) {\n let leaf = node.leaf(i);\n switch(leaf.name()) {\n case Node.CSXChild:\n if(comma) {\n res += ',';\n comma = false;\n }\n res += child(leaf);\n comma = true;\n break;\n case Node.TOKEN:\n let s = leaf.token().content();\n //open和close之间的空白不能忽略\n if(/^\\s+$/.test(s)) {\n if(leaf.prev().name() === Node.CSXOpeningElement && leaf.next().name() === Node.CSXClosingElement) {\n res += '\"' + s.replace(/\"/g, '\\\\\"').replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n\\\\\\n') + '\"';\n }\n else {\n res += s;\n }\n }\n else {\n if(comma) {\n res += ',';\n comma = false;\n }\n res += '\"' + s.replace(/\"/g, '\\\\\"').replace(/\\r/g, '\\\\r').replace(/\\n/g, '\\\\n\\\\\\n') + '\"';\n comma = true;\n }\n break;\n default:\n if(comma) {\n res += ',';\n comma = false;\n }\n res += parse(leaf);\n comma = true;\n }\n }\n res += '])';\n return res;\n}\n\nfunction parse(node) {\n let res = '';\n switch(node.name()) {\n case Node.CSXElement:\n res += elem(node);\n break;\n case Node.CSXSelfClosingElement:\n res += selfClose(node, true).res;\n res += ')';\n break;\n case Node.CSXFragment:\n res += fragment(node);\n break;\n }\n return res;\n}\n\nexport default parse;\n","import homunculus from 'homunculus';\nimport csx from './csx';\nimport ignore from './ignore';\n\nlet Node = homunculus.getClass('node', 'csx');\n\nclass Tree {\n constructor() {\n this.res = '';\n }\n parse(node) {\n this.recursion(node, false);\n return this.res;\n }\n recursion(node) {\n let self = this;\n let isToken = node.isToken();\n if(isToken) {\n let token = node.token();\n if(token.isVirtual()) {\n return;\n }\n if(!token.ignore) {\n this.res += token.content();\n }\n while(token.next()) {\n token = token.next();\n if(token.isVirtual() || !ignore.S.hasOwnProperty(token.type())) {\n break;\n }\n if(!token.ignore) {\n this.res += token.content();\n }\n }\n }\n else {\n switch(node.name()) {\n case Node.CSXElement:\n case Node.CSXSelfClosingElement:\n case Node.CSXFragment:\n this.res += csx(node, {});\n return;\n }\n node.leaves().forEach(function(leaf) {\n self.recursion(leaf);\n });\n }\n }\n}\n\nexport default Tree;\n","import homunculus from 'homunculus';\nimport Tree from './Tree';\nimport { version } from '../package.json';\n\nclass Yurine {\n constructor() {\n this.parser = null;\n this.node = null;\n }\n parse(code) {\n this.parser = homunculus.getParser('csx');\n this.node = this.parser.parse(code);\n let tree = new Tree();\n return tree.parse(this.node);\n }\n tokens() {\n return this.ast ? this.parser.lexer.tokens() : null;\n }\n ast() {\n return this.node;\n }\n\n static parse(code) {\n return new Yurine().parse(code);\n }\n}\n\nlet o = new Yurine();\no.version = version;\n\nexport default o;\n"],"names":["ES6Token","homunculus","getClass","Token","Node","S","LINE","COMMENT","BLANK","res","append","ignore","node","includeLine","isVirtual","next","hasOwnProperty","type","s","content","isToken","token","leaves","forEach","leaf","parse","JsNode","word","recursion","name","TOKEN","VIRTUAL","ID","NUMBER","KEYWORD","indexOf","charAt","length","replace","elem","tag","selfClose","first","comma","i","len","size","CSXChild","child","test","prev","CSXOpeningElement","CSXClosingElement","isCp","last","isClose","CSXMemberExpression","CSXBindAttribute","attr","CSXAttribute","CSXSpreadAttribute","spread","key","v","join","Tree","fragment","CSXElement","CSXSelfClosingElement","CSXFragment","self","csx","Yurine","parser","code","getParser","tree","ast","lexer","tokens","o","version"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEA,IAAIA,QAAQ,GAAGC,UAAU,CAACC,QAAX,CAAoB,OAApB,EAA6B,IAA7B,CAAf;EACA,IAAIC,KAAK,GAAGF,UAAU,CAACC,QAAX,CAAoB,OAApB,EAA6B,KAA7B,CAAZ;EACA,IAAIE,IAAI,GAAGH,UAAU,CAACC,QAAX,CAAoB,MAApB,EAA4B,KAA5B,CAAX;EAEA,IAAIG,CAAC,GAAG,EAAR;EACAA,CAAC,CAACF,KAAK,CAACG,IAAP,CAAD,GAAgBD,CAAC,CAACF,KAAK,CAACI,OAAP,CAAD,GAAmBF,CAAC,CAACF,KAAK,CAACK,KAAP,CAAD,GAAiB,IAApD;EAEA,IAAIC,GAAJ;EACA,IAAIC,MAAJ;;EAEA,SAASC,MAAT,CAAgBC,IAAhB,EAAsBC,WAAtB,EAAmC;EACjC,MAAGD,IAAI,YAAYT,KAAhB,IAAyBS,IAAI,YAAYZ,QAA5C,EAAsD;EACpD,QAAGY,IAAI,CAACE,SAAL,EAAH,EAAqB;EACnB;EACD;;EACDF,IAAAA,IAAI,CAACD,MAAL,GAAc,IAAd;EACAD,IAAAA,MAAM,GAAG,EAAT;;EACA,WAAME,IAAI,GAAGA,IAAI,CAACG,IAAL,EAAb,EAA0B;EACxB,UAAGH,IAAI,CAACE,SAAL,MAAoB,CAACT,CAAC,CAACW,cAAF,CAAiBJ,IAAI,CAACK,IAAL,EAAjB,CAAx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