随笔分类 - 编译原理
js转语法树,转其他的语言
摘要:/** code 转tokens* *///判断字符function isEqual(test,code,pos,end) { if(pos<end&&code.charCodeAt(pos-1)!==92&&test code.substr(pos,test.length)){ return tr
阅读全文
摘要://js语法树节点类型-babel-eslint9const typeMap= { 'File':function (node) { return [node.program]; }, 'Program':function (node) { return [node.body] }, 'Block'
阅读全文
摘要://js语法树节点类型-babylon@6.18const typeMap= { 'CommentBlock':function (node) {}, 'CommentLine':function (node) {}, 'Literal':function (node) {}, 'Expressio
阅读全文