mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
enable support for continuation lines
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1112 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
afc4ec72fe
commit
308b67ec56
@ -482,13 +482,17 @@ ECMD_EvalClassDef($$$)
|
|||||||
# set stop cmd {"io set ddr 2 ff\nio set port 2 1%btnstop\nwait 1000\nio set port 2 00"}
|
# set stop cmd {"io set ddr 2 ff\nio set port 2 1%btnstop\nwait 1000\nio set port 2 00"}
|
||||||
# set down cmd {"io set ddr 2 ff\nio set port 2 1%btndown\nwait 1000\nio set port 2 00"}
|
# set down cmd {"io set ddr 2 ff\nio set port 2 1%btndown\nwait 1000\nio set port 2 00"}
|
||||||
|
|
||||||
|
my $cont= "";
|
||||||
foreach my $line (@classdef) {
|
foreach my $line (@classdef) {
|
||||||
# kill trailing newline
|
# kill trailing newline
|
||||||
chomp $line;
|
chomp $line;
|
||||||
# kill comments and blank lines
|
# kill comments and blank lines
|
||||||
$line=~ s/\#.*$//;
|
$line=~ s/\#.*$//;
|
||||||
$line=~ s/\s+$//;
|
$line=~ s/\s+$//;
|
||||||
|
$line= $cont . $line;
|
||||||
|
if($line=~ s/\\$//) { $cont= $line; undef $line; }
|
||||||
next unless($line);
|
next unless($line);
|
||||||
|
$cont= "";
|
||||||
Log 5, "$name: evaluating >$line<";
|
Log 5, "$name: evaluating >$line<";
|
||||||
# split line into command and definition
|
# split line into command and definition
|
||||||
my ($cmd, $def)= split("[ \t]+", $line, 2);
|
my ($cmd, $def)= split("[ \t]+", $line, 2);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user