提交 31da7dcf 编写于 作者: P pc-ls 提交者: ninecents

LJWT

上级 2092418d
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
}, },
winError() { winError() {
var objJson = []; var objJson = [];
// // (.*)\n//\n#define (\S+)\s+(\d+)L/g
var r = /\/\/ (.*)\n\/\/\n#define (\S+)\s+(\d+)L/g; var r = /\/\/ (.*)\n\/\/\n#define (\S+)\s+(\d+)L/g;
var a = null; var a = null;
while ((a = r.exec(this.current.input))) { //循环执行匹配操作 while ((a = r.exec(this.current.input))) { //循环执行匹配操作
......
...@@ -42,12 +42,26 @@ export default { ...@@ -42,12 +42,26 @@ export default {
item.hex = hex; item.hex = hex;
this.kMaps[k] = item; this.kMaps[k] = item;
this.kMaps[v] = item; this.kMaps[v] = item;
this.kMaps[hex] = item;
}); });
}, },
methods: { methods: {
handle() { handle() {
var item = this.kMaps[this.current.input]; var input = this.current.input.trim();
// 支持后缀H、h、L、l
if (input.endsWith('H') || input.endsWith('h')) {
input = '0x' + input.slice(0, -1);
} else if (input.endsWith('L') || input.endsWith('l')) {
input = input.slice(0, -1);
}
var item = null;
// 不是数字
if (isNaN(Number(input))) {
item = this.kMaps[input];
} else {
// 转为数字,然后转为字符串
item = this.kMaps[Number(input) + ''];
}
console.log(item) console.log(item)
if (item) { if (item) {
this.current.output = item; this.current.output = item;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册