diff --git a/dbLoadTemplate b/dbLoadTemplate index 5f17acb..fa034c4 100755 --- a/dbLoadTemplate +++ b/dbLoadTemplate @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# $Header: /cvs/G/EPICS/App/scripts/dbLoadTemplate,v 1.5 2009/09/07 12:02:33 zimoch Exp $ +# $Header: /cvs/G/EPICS/App/scripts/dbLoadTemplate,v 1.6 2013/02/26 13:35:32 zimoch Exp $ use strict; @@ -120,9 +120,9 @@ sub parseSubst { local %subst; while (1) { my $macro; - do { - $macro = expect "$WORD|,|} macro name"; - } while $_ eq ","; # ignore commas + $macro = expect "$WORD|,|} macro name"; + # one comma allowed + if ($_ eq ",") {$macro = expect "$WORD macro name";} last if $_ eq '}'; expect "=", "$STRING|$SUBST value for $macro"; $subst{$macro} = $_; @@ -135,9 +135,9 @@ sub parseSubst { expect "{"; my @macros; while (1) { - do { - expect "$WORD|,|} macro name"; - } while $_ eq ","; # ignore commas + expect "$WORD|,|} macro name"; + # one comma allowed + if ($_ eq ",") {expect "$WORD macro name";} last if $_ eq '}'; push @macros, $_; }; @@ -146,9 +146,8 @@ sub parseSubst { expect "{|} '{' or '}'"; last if $_ eq "}"; foreach my $macro (@macros) { - do { - expect "$STRING|$SUBST|, value for $macro"; - } while $_ eq ","; # ignore commas + expect "$STRING|$SUBST|, value for $macro"; + if ($_ eq ",") {expect "$STRING|$SUBST value for $macro";} $subst{$macro} = $_; } expect "}";