1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-03-29 12:54:59 +08:00
parent fad25a8ce4
commit ec5102aee6
2 changed files with 18 additions and 7 deletions

View File

@ -47,10 +47,19 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
can.isCmdMode() && can.misc.sessionStorage(can, TABVIEW_HIDE, show? "": html.HIDE)
}
},
_tabPath: function(can, ps, key, value, cb, target) { can.onmotion.clear(can, can.ui.path), can.core.List(can.core.Split(value, ps), function(value, index, list) {
_tabPath: function(can, ps, key, value, cb, target) { can.onmotion.clear(can, can.ui.path), can.core.List(can.core.Split(value.split(ice.FS)[0], ps), function(value, index, list) {
can.page.Append(can, target, [{text: [value+(index<list.length-1? ps: ""), "", html.ITEM], onclick: function(event) {
can.onimport.tabPath(event, can, ps, key, ps == ice.PT? list.slice(0, index).join(ps): (list.slice(0, index).join(ps)||ice.PT)+ps, cb)
}}])
}), can.core.List(value.split(ice.FS[0]).slice(1), function(val) {
var index = value.split(ice.FS)[0]
can.page.Append(can, target, [{text: [val, "", html.ITEM], onclick: function(event) {
can.runAction(can.request(event, {index: index}), mdb.INPUTS, [ctx.ARGS], function(msg) {
can.user.carte(event, can, {}, msg[msg.append[0]], function(event, button) {
can.onimport.tabview(can, "", [index, button].join(ice.FS), ctx.INDEX)
})
})
}}])
}) },
tabPath: function(event, can, ps, key, pre, cb, parent) { can.runAction(event, mdb.INPUTS, [key, pre, lex.SPLIT], function(msg) { var _trans = {}
var carte = can.user[parent? "carteRight": "carte"](event, can, {_style: key}, (msg.Length() > 10? [web.FILTER]: []).concat(msg.Table(function(value) {

View File

@ -163,18 +163,20 @@ Volcanos(chat.ONSYNTAX, {
"Any": code.DATATYPE, "List": code.DATATYPE, "Map": code.DATATYPE, "Maps": code.DATATYPE, "Message": code.DATATYPE,
},
func: function(can, push, text, indent, opts) { var ls = can.core.Split(text, "\t *", "({:})")
function isKey() { return opts.block == "cmds" && ls[1] == ":" && ls[2] == "{" } function isEnd() { return ls[0] == "}" }
function prefix(key, pre) { return key.toLowerCase() == key? "- ": ("+ "+(pre? pre+ice.PT: "")) }
if (indent == 0) { switch (ls[0]) {
case "package": opts.package = ls[1]; break
case "func": if (ls[1] == "(") { ls[1] = ls[2]+ice.PT+ls[5], ls[5].toLowerCase()[0] == ls[5][0]? push("- "+ls[1]): push("+ "+ls[1]); break }
case "func": if (ls[1] == "(") { push(prefix(ls[5])+ls[2]+ice.PT+ls[5]); break }
case "const":
case "var": if (ls[1] == "(") { break }
case "type": ls[1].toLowerCase()[0] == ls[1][0]? push("- "+ls[1]): push("+ "+opts.package+ice.PT+ls[1]); break
} } else if (indent == 4) {
if (text.indexOf("MergeCommands(") > -1) { opts.block = "cmds" } else if (text == "})") { opts.block = "" }
case "type": push(prefix(ls[1], opts.package)+ls[1]); break
} opts.stack = [ls[0]] } else if (indent == 4 && opts.stack[0] == "func") {
if (text.indexOf("MergeCommands(") > -1) { opts.block = "cmds" } else if (text.indexOf("}") == 0) { opts.block = "" }
} else if (indent == 8) {
if (opts.block == "cmds" && ls[1] == ice.DF) { push("+ "+opts.package+ice.PT+ls[0]), opts.block = opts.package+ice.PT+ls[0] }
if (isKey()) { push(prefix(ls[0], opts.package)+ls[0]), opts.cmds = opts.package+ice.PT+ls[0] }
} else if (indent == 12) {
if (opts.block && ls[1] == ice.DF) { push("+ "+opts.block+ice.SP+ls[0]) }
if (isKey()) { push("+ "+opts.cmds+ice.SP+ls[0]) }
}
},
}, mod: {prefix: {"//": code.COMMENT}, keyword: {"go": code.KEYWORD, "module": code.KEYWORD, "require": code.KEYWORD, "replace": code.KEYWORD}}, sum: {},