More ... | 編集履歴:差分2015/09/30 17:38:33 JSTと2015/10/01 01:25:40 JST間のブロック構文っぽいものの変更箇所
[[匿名ラベル]]に引き続き、ブロック構文っぽい構文を提供するマクロ。~% あくまで「っぽい」であり、レキシカルスコープなどはない。 [https://github.com/vain0/abdata abdata]のIterateマクロを参考にしました。 ** notesel, noteunsel ※noteunselの仕様上、入れ子は1つまでです。 {{{ #define global ctype note(%1) %tnotesel_unsel notesel %1: gosub *%i: noteunsel: if 0 : *%o sdim buf1, 256 sdim buf2, 256 note( buf1 ) { noteadd "This is buf1" note( buf2 ) { noteadd "This is buf2" noteadd "----buf2----" return } noteadd "----buf1----" return } mes buf1 mes buf2 }}} + + ** newmod, delmod + {{{ + #define global ctype mod(%1,%2) %tmod newmod %1,%2 : gosub *%i : delmod %1 : if 0 : *%o + + #module a var1 + #modinit + mes "ModInit" + var1 = "ModFunc" + return + + #modterm + mes "ModTerm" + return + + #modfunc func + mes var1 + return + #global + + + mod ( test, a ) { + func test + + return + } + }}} |