summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelliott_c <ocielliottc@users.noreply.github.com>2005-04-25 15:36:03 +0000
committerelliott_c <ocielliottc@users.noreply.github.com>2005-04-25 15:36:03 +0000
commit9776356f7b879d7766f8d30f3b2e338e30db22b7 (patch)
treeb8c3d232731ed5e41f261efbccf796d2c3056043
parente423fb9705e8e785be6728bc8744c7ac14cd9ef7 (diff)
downloadMPC-9776356f7b879d7766f8d30f3b2e338e30db22b7.tar.gz
ChangeLogTag: Mon Apr 25 10:31:48 2005 Chad Elliott <elliott_c@ociweb.com>
-rw-r--r--ChangeLog15
-rw-r--r--config/xerces.mpb5
-rw-r--r--modules/ProjectCreator.pm72
-rw-r--r--modules/TemplateParser.pm21
4 files changed, 74 insertions, 39 deletions
diff --git a/ChangeLog b/ChangeLog
index 650b76d8..df0b2a3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Mon Apr 25 10:31:48 2005 Chad Elliott <elliott_c@ociweb.com>
+
+ * config/xerces.mpb:
+
+ Set Debug::xerceslib in addition to xerceslib to ensure that the
+ debug version of xerces is linked into Debug configurations for
+ Visual C++. Linking the optimized version into debug applications
+ has been reported to cause run-time issues.
+
+ * modules/ProjectCreator.pm:
+ * modules/TemplateParser.pm:
+
+ Fixed a bug where the scope name of a template variable being
+ expanded from $(...) was not taken into account.
+
Mon Apr 18 13:16:52 2005 Chad Elliott <elliott_c@ociweb.com>
* templates/em3vcp.mpd:
diff --git a/config/xerces.mpb b/config/xerces.mpb
index 402d59b5..86df4a14 100644
--- a/config/xerces.mpb
+++ b/config/xerces.mpb
@@ -7,6 +7,11 @@ project {
specific (em3, vc6, vc7, vc71, vc8, nmake) {
xerceslib = xerces-c_2
+
+ // Linking the optimized version of xerces-c_2 into a debug application
+ // has been known to cause run-time issues (as of 4/25/2005), so we
+ // will link in the debug version for the "Debug" configuration.
+ Debug::xerceslib = xerces-c_2D
}
specific(borland, bmake, cbx) {
xerceslib = XercesLib
diff --git a/modules/ProjectCreator.pm b/modules/ProjectCreator.pm
index a359b566..473b6704 100644
--- a/modules/ProjectCreator.pm
+++ b/modules/ProjectCreator.pm
@@ -995,7 +995,8 @@ sub parse_components {
my($fh) = shift;
my($tag) = shift;
my($name) = shift;
- my($current) = $self->get_default_element_name();
+ my($defel) = $self->get_default_element_name();
+ my($current) = $defel;
my($status) = 1;
my($names) = {};
my($comps) = {};
@@ -1044,35 +1045,10 @@ sub parse_components {
}
elsif ($line =~ /^(\w+)\s*{$/) {
if (!defined $current || !$set) {
- if (defined $current) {
- if (!defined $$comps{$current}->[0]) {
- ## The default components name was never used
- ## so we remove it from the components
- delete $$comps{$current};
- }
- else {
- ## It was used, so we need to add that name to
- ## the set of group names unless it's already been added.
- my($groups) = $self->get_assignment($grtag);
- my($addgroup) = 1;
- if (defined $groups) {
- foreach my $group (@{$self->create_array($groups)}) {
- if ($current eq $group) {
- $addgroup = 0;
- last;
- }
- }
- }
- if ($addgroup) {
- $self->process_assignment_add($grtag, $current);
- }
- }
- }
$current = $1;
$set = 1;
if (!defined $$comps{$current}) {
$$comps{$current} = [];
- $self->process_assignment_add($grtag, $current);
}
}
else {
@@ -1089,11 +1065,46 @@ sub parse_components {
}
}
elsif ($line =~ /^}$/) {
+ if (defined $current) {
+ if (!defined $$comps{$current}->[0]) {
+ ## The default components name was never used
+ ## so we remove it from the components
+ delete $$comps{$current};
+ }
+ else {
+ ## It was used, so we need to add that name to
+ ## the set of group names unless it's already been added.
+ my($groups) = $self->get_assignment($grtag);
+ my($addgroup) = 1;
+ if (defined $groups) {
+ foreach my $group (@{$self->create_array($groups)}) {
+ if ($current eq $group) {
+ $addgroup = 0;
+ last;
+ }
+ }
+ }
+ if ($addgroup) {
+ $self->process_assignment_add($grtag, $current);
+ }
+ }
+ }
if (defined $current && $set) {
- $current = $self->get_default_element_name();
+ $current = $defel;
$set = undef;
}
else {
+ ## We are at the end of a component. If the only group
+ ## we added was the default group, then we need to remove
+ ## the group setting altogether.
+ my($groups) = $self->get_assignment($grtag);
+ if (defined $groups) {
+ my(@grarray) = @{$self->create_array($groups)};
+ if ($#grarray == 0 && $grarray[0] eq $defel) {
+ $self->process_assignment($grtag, undef);
+ }
+ }
+
## This is not an error,
## this is the end of the components
last;
@@ -3864,12 +3875,13 @@ sub relative {
my($self) = shift;
my($value) = shift;
my($expand_template) = shift;
+ my($scope) = shift;
if (defined $value) {
if (UNIVERSAL::isa($value, 'ARRAY')) {
my(@built) = ();
foreach my $val (@$value) {
- push(@built, $self->relative($val, $expand_template));
+ push(@built, $self->relative($val, $expand_template, $scope));
}
$value = \@built;
}
@@ -3952,7 +3964,9 @@ sub relative {
if (defined $ti) {
$val = $ti->get_value($name);
}
- my($arr) = $self->adjust_value([$name], (defined $val ? $val : []));
+ my($sname) = (defined $scope ? $scope . "::$name" : undef);
+ my($arr) = $self->adjust_value([$sname, $name],
+ (defined $val ? $val : []));
if (defined $$arr[0]) {
$val = "@$arr";
if ($self->{'convert_slashes'}) {
diff --git a/modules/TemplateParser.pm b/modules/TemplateParser.pm
index cec22625..f1a105e5 100644
--- a/modules/TemplateParser.pm
+++ b/modules/TemplateParser.pm
@@ -198,7 +198,8 @@ sub get_value {
my($value) = undef;
my($counter) = $self->{'foreach'}->{'count'};
my($fromprj) = 0;
- my($scoped) = undef;
+ my($scope) = undef;
+ my($sname) = undef;
my($adjust) = 1;
## First, check the temporary scope (set inside a foreach)
@@ -206,8 +207,8 @@ sub get_value {
## Find the outer most scope for our variable name
for(my $index = $counter; $index >= 0; --$index) {
if (defined $self->{'foreach'}->{'scope_name'}->[$index]) {
- $scoped = $self->{'foreach'}->{'scope_name'}->[$index] .
- '::' . $name;
+ $scope = $self->{'foreach'}->{'scope_name'}->[$index];
+ $sname = $scope . '::' . $name;
last;
}
}
@@ -227,7 +228,7 @@ sub get_value {
if (!defined $value) {
## Calling adjust_value here allows us to pick up template
## overrides before getting values elsewhere.
- my($uvalue) = $self->{'prjc'}->adjust_value([$scoped, $name], []);
+ my($uvalue) = $self->{'prjc'}->adjust_value([$sname, $name], []);
if (defined $$uvalue[0]) {
$value = $uvalue;
$adjust = 0;
@@ -275,7 +276,7 @@ sub get_value {
## Adjust the value even if we haven't obtained one from an outside
## source.
if ($adjust && defined $value) {
- $value = $self->{'prjc'}->adjust_value([$scoped, $name], $value);
+ $value = $self->{'prjc'}->adjust_value([$sname, $name], $value);
}
## If the value did not come from the project creator, we
@@ -296,7 +297,7 @@ sub get_value {
}
}
- return $self->{'prjc'}->relative($value);
+ return $self->{'prjc'}->relative($value, undef, $scope);
}
@@ -309,20 +310,20 @@ sub get_value_with_default {
$value = $self->{'defaults'}->{$name};
if (defined $value) {
my($counter) = $self->{'foreach'}->{'count'};
- my($scoped) = undef;
+ my($sname) = undef;
if ($counter >= 0) {
## Find the outer most scope for our variable name
for(my $index = $counter; $index >= 0; --$index) {
if (defined $self->{'foreach'}->{'scope_name'}->[$index]) {
- $scoped = $self->{'foreach'}->{'scope_name'}->[$index] .
- '::' . $name;
+ $sname = $self->{'foreach'}->{'scope_name'}->[$index] .
+ '::' . $name;
last;
}
}
}
$value = $self->{'prjc'}->relative(
- $self->{'prjc'}->adjust_value([$scoped, $name], $value));
+ $self->{'prjc'}->adjust_value([$sname, $name], $value));
}
else {
#$self->warning("$name defaulting to empty string.");