-
Notifications
You must be signed in to change notification settings - Fork 67
DRAFT: Skip variable parse checks during fortran parsing #673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
298baed
1ba5a3e
33e97e4
3167698
449216e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -262,7 +262,7 @@ class Var: | |
| # All constituent props are optional so no check | ||
|
|
||
| def __init__(self, prop_dict, source, run_env, context=None, | ||
| clone_source=None): | ||
| clone_source=None, skip_checks=False): | ||
| """Initialize a new Var object. | ||
| If <prop_dict> is really a Var object, use that object's prop_dict. | ||
| If this Var object is a clone, record the original Var object | ||
|
|
@@ -360,19 +360,21 @@ def __init__(self, prop_dict, source, run_env, context=None, | |
| # # end if | ||
| # # end for | ||
| # XXgoldyXX: ^ don't fill in default properties? | ||
| # Make sure all the variable values are valid | ||
| try: | ||
| for prop_name, prop_val in self.var_properties(): | ||
| prop = Var.get_prop(prop_name) | ||
| _ = prop.valid_value(prop_val, | ||
| prop_dict=self._prop_dict, error=True) | ||
| # end for | ||
| except CCPPError as cperr: | ||
| lname = self._prop_dict['local_name'] | ||
| emsg = "{}: {}" | ||
| raise ParseSyntaxError(emsg.format(lname, cperr), | ||
| context=self.context) from cperr | ||
| # end try | ||
| # Make sure all the variable values are validi | ||
| if not skip_checks: | ||
| try: | ||
| for prop_name, prop_val in self.var_properties(): | ||
| prop = Var.get_prop(prop_name) | ||
| _ = prop.valid_value(prop_val, | ||
| prop_dict=self._prop_dict, error=True) | ||
| # end for | ||
| except CCPPError as cperr: | ||
| lname = self._prop_dict['local_name'] | ||
| emsg = "{}: {}" | ||
| raise ParseSyntaxError(emsg.format(lname, cperr), | ||
| context=self.context) from cperr | ||
| # end try | ||
| # end if | ||
|
|
||
| def compatible(self, other, run_env, is_tend=False): | ||
| """Return a VarCompatObj object which describes the equivalence, | ||
|
|
@@ -1209,9 +1211,10 @@ def __init__(self, prop_dict, source, run_env, context=None, | |
| del prop_dict[prop.name] | ||
| # end if | ||
| # end for | ||
| # Initialize Var | ||
| # Initialize Var; skip the parse checkers on the Fortran side since the | ||
| # checks are already done during metadata parsing | ||
climbfuji marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| super().__init__(prop_dict, source, run_env, context=context, | ||
| clone_source=clone_source) | ||
| clone_source=clone_source, skip_checks=True) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels like the wrong place to add this check as the problem (which I do not really follow without a regression test to read) is not within this type but its use in parse_fortran.py.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added some new test files to the ddthost test that will cause the test to fail without the changes in this PR. Hope that helps - and thanks for the suggestion to add a test. I'm not sure I'm following your suggestion here. The checks are done in |
||
| # Now, restore the saved properties | ||
| for prop in save_dict: | ||
| self._prop_dict[prop] = save_dict[prop] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.