提交 2092418d 编写于 作者: N ninecents

winerror生成、constFinder

上级 0cada6e4
此差异已折叠。
......@@ -77,7 +77,7 @@
"vue-i18n": "^8.27.0",
"vue-router": "^3.5.3",
"vuedraggable": "^2.24.3",
"x2js": "git+https://hub.fastgit.xyz​​/abdolence/x2js.git",
"x2js": "git+https://gitee.com/ltlwill/x2js.git",
"xml-formatter": "^2.6.1"
},
"devDependencies": {
......
......@@ -69,6 +69,7 @@ const tool = [
// yeahmao
{'name': 'hexConvert', 'cat': ['yeahmao']},
{'name': 'constFinder', 'cat': ['yeahmao']},
// code_gen
{'name': 'codeGenJson', 'cat': ['code_gen']},
{'name': 'codeGenJava', 'cat': ['code_gen']},
......
......@@ -78,6 +78,7 @@
"tool_hexConvert": "hexConvert",
"tool_codeGenJson": "codeGenJson",
"tool_codeGenJava": "codeGenJava",
"tool_constFinder": "constFinder",
// other
"css_main_category_item_style": "padding: 0 10px",
"editor_line_wrapping": "Line Wrapping",
......
......@@ -78,6 +78,7 @@
"tool_hexConvert": "字节转换",
"tool_codeGenJson": "代码生成Json",
"tool_codeGenJava": "代码生成Java",
"tool_constFinder": "常量查找",
// 其他
"css_main_category_item_style": "padding: 0 20px",
"editor_line_wrapping": "自动换行",
......
......@@ -166,6 +166,10 @@ const routes = [
path: '/yeahmao/hexConvert',
component: r => require(['./views/yeahmao/hexConvert.vue'], r)
},
{
path: '/yeahmao/constFinder',
component: r => require(['./views/yeahmao/constFinder'], r)
},
{
path: '/yeahmao/code_gen/codeGenJson',
component: r => require(['./views/yeahmao/code_gen/codeGenJson.vue'], r)
......
......@@ -58,7 +58,7 @@ export default {
currentTool(name) {
console.log(name)
model.setCurrentTool(name)
if (name == 'hexConvert') {
if (['hexConvert', 'constFinder'].indexOf(name) != -1) {
this.$router.push('/yeahmao/' + name)
} else if (['codeGenJson', 'codeGenJava'].indexOf(name) != -1) {
this.$router.push('/yeahmao/code_gen/' + name)
......
......@@ -5,6 +5,7 @@
<FormItem>
<ButtonGroup>
<Button type="primary" @click="codeGenJson()">{{ $t('allMy_convert') }}</Button>
<Button type="primary" @click="winError()"> winerror.h </Button>
<!-- <Button type="primary" @click="handle('str')">Hex -> String</Button> -->
</ButtonGroup>
</FormItem>
......@@ -95,6 +96,18 @@ export default {
console.log('leave...', objJson)
this.current.output = JSON.stringify(objJson, null, 4)
},
winError() {
var objJson = [];
var r = /\/\/ (.*)\n\/\/\n#define (\S+)\s+(\d+)L/g;
var a = null;
while ((a = r.exec(this.current.input))) { //循环执行匹配操作
console.log("匹配文本 = " + a[0] + " a.index = " + a.index + " r.lastIndex = " + r.lastIndex); //显示每次匹配后返回的数组信息
var [_, desc, k, v] = a;
objJson.push({desc: desc, k: k, v: v});
}
this.current.output = JSON.stringify(objJson);
console.log(Object.keys(objJson).length);
},
resize(height) {
this.inputHeight = Math.min(320, Math.ceil(height / 2))
this.outputHeight = height - this.inputHeight
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册