Skip to content

Commit

Permalink
v3.0.59b
Browse files Browse the repository at this point in the history
  • Loading branch information
kujirahand committed Apr 15, 2019
1 parent b9b050c commit c689ea7
Show file tree
Hide file tree
Showing 24 changed files with 1,008 additions and 533 deletions.
10 changes: 8 additions & 2 deletions batch/cmd_txt2wiki.nako3
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ TPL=「」
WIKI=""
PLUG={}
PLUG2={}
PLUG3={}
PLUG拡張={}
WIKI3=「■なでしこ3のプラグイン一覧」&改行&改行

Expand All @@ -26,6 +27,7 @@ WIKI3=「■なでしこ3のプラグイン一覧」&改行&改行
目次=目次&改行&「■ [[{プラグイン名}]] ([[{プラグイン拡張}]])」&改行
目次=目次&「#page({プラグイン名}/解説)」&改行
PLUG[プラグイン名] = ""
PLUG3[プラグイン名] = ""
PLUG拡張[プラグイン名] = "[[拡張プラグイン]]"
    続ける。
  ここまで。
Expand All @@ -36,6 +38,7 @@ WIKI3=「■なでしこ3のプラグイン一覧」&改行&改行
目次=目次&改行&「■ [[{プラグイン名}]]」&改行
目次=目次&「#page({プラグイン名}/解説)」&改行
PLUG[プラグイン名] = ""
PLUG3[プラグイン名] = ""
PLUG拡張[プラグイン名] = "プラグイン"
    続ける。
  ここまで。
Expand All @@ -47,6 +50,7 @@ WIKI3=「■なでしこ3のプラグイン一覧」&改行&改行
目次=目次&改行&「● [[{表題}:{プラグイン名}]]」&改行
PLUG[プラグイン名] = PLUG[プラグイン名] & "- [[{表題}:{プラグイン名}/{表題}]]"&改行
PLUG2["{プラグイン名}/{表題}"] = ""
PLUG3[プラグイン名] = PLUG3[プラグイン名] & "▲[[{プラグイン名}/{表題}]]" & 改行
    続ける。
  ここまで。
#コマンドか?
Expand All @@ -69,7 +73,9 @@ WIKI3=「■なでしこ3のプラグイン一覧」&改行&改行
違えば
目次=目次&「- [[({引数}){名前}:{ページ名}]] --- {説明}」&改行
ここまで。
PLUG2["{プラグイン名}/{表題}"] = PLUG2["{プラグイン名}/{表題}"]&「- [[{名前}:{ページ名}]] --- {説明}」&改行
F説明=「- [[{名前}:{ページ名}]] --- {説明}」
PLUG2["{プラグイン名}/{表題}"] = PLUG2["{プラグイン名}/{表題}"]&F説明&改行
PLUG3[プラグイン名] = PLUG3[プラグイン名] & F説明 & 改行
###
WIKI=WIKI&「###PAGE###:w:{ページ名}」&改行
WIKI=WIKI&「■ {名前} ({ヨミ})」&改行
Expand Down Expand Up @@ -126,7 +132,7 @@ PLUGを反復
WIKI=WIKI&「###PAGE###:w:{プラグイン名}」&改行
WIKI=WIKI&「■ {プラグイン名} - なでしこ3 {拡張}」&改行
WIKI=WIKI&「#page({プラグイン名}/解説)」&改行&改行
WIKI=WIKI&「▲ プラグインで使える命令のカテゴリ」&改行&改行
WIKI=WIKI&PLUG3[プラグイン名]&改行&改行
WIKI=WIKI&トリム(対象)&改行&改行
WIKI=WIKI&「▲ 参考」&改行
WIKI=WIKI&「- [[命令一覧/機能順]] > [[プラグイン一覧]]」&改行
Expand Down
478 changes: 465 additions & 13 deletions batch/wiki-command2.txt

Large diffs are not rendered by default.

Binary file modified bin/nakopad.exe
Binary file not shown.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"no-console": "off",
"curly": [
"error",
"multi"
"all"
]
},
"plugins": [
Expand Down Expand Up @@ -125,7 +125,6 @@
"fs-extra": "^6.0.0",
"iconv-lite": "^0.4.24",
"moment-timezone": "^0.5.23",
"nadesiko3-sqlite3": "0.0.3",
"node-fetch": "^2.3.0",
"opener": "^1.5.1",
"react": "^16.7.0",
Expand Down
20 changes: 10 additions & 10 deletions src/cnako3.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class CNako3 extends NakoCompiler {
registerCommands () {
// コマンド引数がないならば、ヘルプを表示(-hはcommandarにデフォルト用意されている)
if (process.argv.length <= 2)
process.argv.push('-h')
{process.argv.push('-h')}

// commanderを使って引数を解析する
const app = require('commander')
Expand Down Expand Up @@ -52,9 +52,9 @@ class CNako3 extends NakoCompiler {
let mainfile = app.args[0]
let output = app.output
if (/\.(nako|nako3|txt|bak)$/.test(mainfile)) {
if (!output) output = mainfile.replace(/\.(nako|nako3)$/, '.js')
if (!output) {output = mainfile.replace(/\.(nako|nako3)$/, '.js')}
} else {
if (!output) output = mainfile + '.js'
if (!output) {output = mainfile + '.js'}
mainfile += '.nako3'
}
// デバッグモードの指定
Expand All @@ -80,7 +80,7 @@ class CNako3 extends NakoCompiler {
// 実行する
execCommand () {
const opt = this.checkArguments()
if (opt.mainfile) this.filename = opt.mainfile
if (opt.mainfile) {this.filename = opt.mainfile}
if (opt.repl) {
this.cnakoRepl(opt)
return
Expand Down Expand Up @@ -120,10 +120,10 @@ class CNako3 extends NakoCompiler {
js
fs.writeFileSync(opt.output, jscode, 'utf-8')
if (opt.run)
exec(`node ${opt.output}`, function (err, stdout, stderr) {
if (err) console.log('[ERROR]', stderr)
{exec(`node ${opt.output}`, function (err, stdout, stderr) {
if (err) {console.log('[ERROR]', stderr)}
console.log(stdout)
})
})}

}

Expand Down Expand Up @@ -156,7 +156,7 @@ class CNako3 extends NakoCompiler {
continue
}
const m = s.match(/["'](.+)["'](|)/)
if (!m) continue
if (!m) {continue}
// プラグインの取り込み
const pname = m[1]
let fullpath = pname
Expand All @@ -170,7 +170,7 @@ class CNako3 extends NakoCompiler {
this.addPluginFile(pname, fullpath, plugmod)
// this.funclistを更新する
for (const key in plugmod)
this.funclist[key] = plugmod[key]
{this.funclist[key] = plugmod[key]}

} catch (e) {
throw new Error(
Expand All @@ -187,5 +187,5 @@ if (require.main === module) { // 直接実行する
const cnako3 = new CNako3()
cnako3.execCommand()
} else // モジュールとして使う場合
module.exports = CNako3
{module.exports = CNako3}

2 changes: 1 addition & 1 deletion src/enako3.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Menu = electron.Menu

app.on('window-all-closed', () => {
if (process.platform !== 'darwin')
app.quit()
{app.quit()}

})

Expand Down
14 changes: 7 additions & 7 deletions src/nako3.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ class NakoCompiler {
// 単語に分割
const tokens = this.tokenize(code, true)
for (let i = 0; i < tokens.length; i++)
if (tokens[i]['type'] === 'code') {
{if (tokens[i]['type'] === 'code') {
tokens.splice(i, 1, ...this.tokenize(tokens[i]['value'], false, tokens[i]['line']))
i--
}
}}

if (this.debug && this.debugLexer) {
console.log('--- lex ---')
Expand All @@ -138,7 +138,7 @@ class NakoCompiler {
}

_run (code, isReset) {
if (isReset) this.reset()
if (isReset) {this.reset()}
let js = this.compile(code)
let __varslist = this.__varslist
let __vars = this.__vars = this.__varslist[2] // eslint-disable-line
Expand Down Expand Up @@ -193,21 +193,21 @@ class NakoCompiler {
// 変数のメタ情報を確認
const __v0 = this.__varslist[0]
if (__v0.meta === undefined)
__v0.meta = {}
{__v0.meta = {}}

// プラグインの値をオブジェクトにコピー
for (const key in po) {
const v = po[key]
this.funclist[key] = v
if (v.type === 'func')
__v0[key] = v.fn
{__v0[key] = v.fn}
else if (v.type === 'const' || v.type === 'var') {
__v0[key] = v.value
__v0.meta[key] = {
readonly: (v.type === 'const')
}
} else
throw new Error('プラグインの追加でエラー。', null)
{throw new Error('プラグインの追加でエラー。', null)}

}
}
Expand Down Expand Up @@ -239,7 +239,7 @@ class NakoCompiler {
addPluginFile (objName, path, po) {
this.addPluginObject(objName, po)
if (this.pluginfiles[objName] === undefined)
this.pluginfiles[objName] = path
{this.pluginfiles[objName] = path}

}

Expand Down
2 changes: 1 addition & 1 deletion src/nako3_assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const PluginAssert = {
type: 'func',
josi: [['と'], ['で']],
fn: function (a, b, sys) {
assert.equal(a, b)
assert.strictEqual(a, b)
},
return_none: true
}
Expand Down
Loading

0 comments on commit c689ea7

Please sign in to comment.