From 0926f5d58b58559da489fb5bbc0f9f414a33f77a Mon Sep 17 00:00:00 2001 From: harveyshao Date: Mon, 7 Mar 2022 11:10:51 +0800 Subject: [PATCH] opt some --- base/nfs/cat.go | 2 ++ core/code/js.go | 73 +++++++++++++++++++++--------------------------- misc/vim/vim.shy | 15 ++++++++-- 3 files changed, 46 insertions(+), 44 deletions(-) diff --git a/base/nfs/cat.go b/base/nfs/cat.go index bb1428ca..fb29f05d 100644 --- a/base/nfs/cat.go +++ b/base/nfs/cat.go @@ -110,6 +110,8 @@ func _cat_list(m *ice.Message, name string) { break } buf = append(buf, make([]byte, ice.MOD_BUFS)...) + } else { + break } } m.Echo(string(buf)) diff --git a/core/code/js.go b/core/code/js.go index e793a9bf..bd8edb2c 100644 --- a/core/code/js.go +++ b/core/code/js.go @@ -86,51 +86,42 @@ func init() { )}, JS: {Name: JS, Help: "js", Value: kit.Data(INSTALL, kit.List(kit.Dict( cli.OSID, cli.ALPINE, ice.CMD, kit.List("apk", "add", "nodejs"), - )), PLUG, kit.Dict( - mdb.RENDER, kit.Dict(), - SPLIT, kit.Dict("space", " \t", "operator", "{[(&.,;!|<>)]}"), - PREFIX, kit.Dict("//", COMMENT, "/*", COMMENT, "*", COMMENT), PREPARE, kit.Dict( - KEYWORD, kit.Simple( - "import", "from", "export", - "var", "new", "delete", "typeof", "const", "function", - "if", "else", "for", "while", "break", "continue", "switch", "case", "default", - "return", "try", "throw", "catch", "finally", - "can", "sub", "msg", "res", "target", + )), PLUG, kit.Dict(PREFIX, kit.Dict("// ", COMMENT, "/* ", COMMENT, "* ", COMMENT), PREPARE, kit.Dict( + KEYWORD, kit.Simple( + "import", "from", "export", - "window", - "console", - "document", - "event", - ), - CONSTANT, kit.Simple( - "true", "false", - "undefined", "null", - "-1", "0", "1", "2", "10", - ), - FUNCTION, kit.Simple( - "arguments", - "Date", - "JSON", + "var", "new", "instanceof", "typeof", "let", "const", + "delete", - "__proto__", - "setTimeout", - "createElement", - "appendChild", - "removeChild", - "parentNode", - "childNodes", + "if", "else", "for", "in", "do", "while", "break", "continue", "switch", "case", "default", + "try", "throw", "catch", "finally", + "return", - "Volcanos", - "request", - "require", + "can", "sub", "msg", "res", - "cb", - "cbs", - "shy", - "pane", - "plugin", - ), - ), KEYWORD, kit.Dict(), + "event", "target", "debugger", "alert", + "window", "screen", "console", "navigator", + "location", "history", + "document", + ), + CONSTANT, kit.Simple( + "true", "false", + "-1", "0", "1", "2", "10", + "undefined", "null", "NaN", + ), + FUNCTION, kit.Simple( + "function", "arguments", "this", + "shy", "Volcanos", "cb", "cbs", + + "parseInt", "parseFloat", + "Number", "String", "Boolean", + "Object", "Array", + "RegExp", "XMLHttpRequest", + "Promise", + "Math", "Date", "JSON", + "setTimeout", + ), + ), KEYWORD, kit.Dict(), ))}, }}, nil) } diff --git a/misc/vim/vim.shy b/misc/vim/vim.shy index 9a73cb28..b67c63fc 100644 --- a/misc/vim/vim.shy +++ b/misc/vim/vim.shy @@ -11,16 +11,25 @@ field "源码" web.code.inner args `usr/install/vim-vim-12be734/ src/main.c 110` section "构建" spark shell ` -yum install -y wget make gcc -yum install -y ncurses-devel.x86_64 bzip2.x86_64 - wget http://mirrors.tencent.com/macports/distfiles/vim/vim-8.2.2681.tar.gz tar xvf vim-8.2.2681.tar.gz && cd vim-vim-12be734 +yum install -y wget make gcc +yum install -y ncurses-devel.x86_64 bzip2.x86_64 + ./configure --prefix=$PWD/_install --enable-multibyte=yes make -j8 && make install ` +spark shell ` +yum install python python-devel python36u python36u-devel +yum install tcl-devel perl perl-devel perl-ExtUtils-ParseXS perl-ExtUtils-XSpp perl-ExtUtils-CBuilder perl-ExtUtils-Embed cscope gtk3-devel libSM-devel libXt-devel libXpm-devel libappstream-glib libacl-devel gpm-devel +yum install ncurses-devel + +./configure --prefix=$PWD/_install --enable-multibyte --with-features=huge --enable-rubyinterp=yes --enable-pythoninterp=yes --enable-python3interp=yes --with-python-config-dir=/usr/lib64/python2.7/config --enable-python3interp=yes --with-python3-config-dir=/usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu --with-tlib=ncurses --enable-perlinterp=yes --enable-luainterp=yes --enable-terminal --enable-cscope +make -j8 && make install +` + section "启动" spark shell ` cd ./_install