Скачал из svn свежую версию макро-плагина. И обнаружил такой глюк: если в файле macros.txt прописать директиву !include, то всё остальное, что следует за этой директивой - просто код макросов и другие !include - пропускается, не прочитывается макро-плагином.
Вот например, есть пара файлов, которые подключаются !include'ами и файл с макросами:
control filea.txt
Код: Выделить всё
#
macro a {
log This is "a" from include
}
Код: Выделить всё
#
macro b {
log This is "b" from include
}
Код: Выделить всё
#
macro c {
log This is "c" from macros.txt
}
!include filea.txt
macro d {
log This is "d" from macros.txt
}
!include fileb.txt
macro e {
log This is "e" from macros.txt
}
Лог консоли:
Код: Выделить всё
macro list
The following macros are available:
----------macros---------
c
a
--------automacros-------
---------Perl Sub--------
-------------------------
Я не знаю, в чём дело, но методом физического тыка выяснил следующее:
Сейчас в файле openkore\plugins\Macro\Parser.pm есть такой код:
Код: Выделить всё
open FILE, "<:utf8", $file or return 0;
while (<FILE>) {
$. == 1 && s/^\x{FEFF}//; # utf bom
s/(.*)[\s\t]+#.*$/$1/; # remove last comments
s/^\s*#.*$//; # remove comments
s/^\s*//; # remove leading whitespaces
Код: Выделить всё
open FILE, "<:utf8", $file or return 0;
foreach (<FILE>) {
$. == 1 && s/^\x{FEFF}//; # utf bom
s/(.*)[\s\t]+#.*$/$1/; # remove last comments
s/^\s*#.*$//; # remove comments
s/^\s*//; # remove leading whitespaces