From 5518b07da0bed73c357283725660dafa3a85481f Mon Sep 17 00:00:00 2001 From: Colin Eles Date: Tue, 8 Mar 2011 15:04:19 +0000 Subject: [PATCH] found bug in checking for imports now checks results grid as well git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@7025 57e6efec-57d4-0310-aeb1-a6c144bb1a8b --- @PVS_checker/pvs_check_for_imports.m | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/@PVS_checker/pvs_check_for_imports.m b/@PVS_checker/pvs_check_for_imports.m index 6e9e5c5..1d60f92 100644 --- a/@PVS_checker/pvs_check_for_imports.m +++ b/@PVS_checker/pvs_check_for_imports.m @@ -16,11 +16,48 @@ function string = pvs_check_for_imports(object) [string,found] = object.pvs_check_for_imports_g(object.data.Grid2,{}); [string2,found2] = object.pvs_check_for_imports_g(object.data.Grid1,found); + + + + % check for imports in the inputs field hashtable = {{'sqrt', 'reals@sqrt'} {'sin', 'trig@trig_basic'} {'cos', 'trig@trig_basic'} {'tan', 'trig@trig_basic'}}; + +% check for imports in the results grid. +for i=1:size(object.data.Grid0.Cells,2) + + text = char(object.data.Grid0.Cells(i).result_text); + + vars = regexp(text,'([a-zA-Z][a-zA-Z0-9_]*)','match'); + + + + + for j=1:size(vars,2) + if(exist(vars{j},'file')==2 && ~strcmp(vars{j},'otherwise')) + %check if already imported file + if (~any(ismember(found,vars{j}))) + string = [string 'IMPORTING ' vars{j} sprintf('\n')]; + found = [found vars{j}]; + end + end + + for k=1:size(hashtable,2) + if strcmp(vars{j},hashtable{k}(1)) + if (~any(ismember(found,vars{j}))) + string = [string 'IMPORTING ' char(hashtable{k}(2)) sprintf('\n')]; + found = [found vars{j}]; + end + end + end + end +end + + + for k=1:size(hashtable,2) functions = regexp(char(object.data.function_inputs),hashtable{k}(1),'once') -- GitLab