From: Patrick G. <sf...@us...> - 2006-05-08 09:55:55
|
Update of /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/languages/sf/sfcomponentdescription In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12840a/smartfrog/src/org/smartfrog/sfcore/languages/sf/sfcomponentdescription Modified Files: SFComponentDescriptionImpl.java Log Message: new function references Index: SFComponentDescriptionImpl.java =================================================================== RCS file: /cvsroot/smartfrog/core/smartfrog/src/org/smartfrog/sfcore/languages/sf/sfcomponentdescription/SFComponentDescriptionImpl.java,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** SFComponentDescriptionImpl.java 5 May 2006 08:13:13 -0000 1.30 --- SFComponentDescriptionImpl.java 8 May 2006 09:55:51 -0000 1.31 *************** *** 33,38 **** import org.smartfrog.sfcore.languages.sf.Phase; import org.smartfrog.sfcore.languages.sf.SmartFrogCompileResolutionException; - import org.smartfrog.sfcore.parser.Phases; import org.smartfrog.sfcore.languages.sf.PhaseNames; import org.smartfrog.sfcore.reference.HereReferencePart; import org.smartfrog.sfcore.reference.Reference; --- 33,39 ---- import org.smartfrog.sfcore.languages.sf.Phase; import org.smartfrog.sfcore.languages.sf.SmartFrogCompileResolutionException; import org.smartfrog.sfcore.languages.sf.PhaseNames; + import org.smartfrog.sfcore.parser.Phases; + import org.smartfrog.sfcore.parser.ReferencePhases; import org.smartfrog.sfcore.reference.HereReferencePart; import org.smartfrog.sfcore.reference.Reference; *************** *** 514,521 **** if (result instanceof SFComponentDescription) { // need to do this as it may link to the file root! ! ((SFComponentDescription) result).doLinkResolve(resState); } } } catch (Exception resex) { resState.addUnresolved(value, sfCompleteName()); } catch (Throwable thr) { --- 515,526 ---- if (result instanceof SFComponentDescription) { // need to do this as it may link to the file root! ! if (((SFComponentDescription) result).sfParent() == null) { ! ((SFComponentDescription) result).setParent(this); ! } ! ((SFComponentDescription) result).doLinkResolve(resState); } } } catch (Exception resex) { + resex.printStackTrace(); resState.addUnresolved(value, sfCompleteName()); } catch (Throwable thr) { *************** *** 599,606 **** Object value = context.get(key); ! if (value instanceof SFComponentDescription) { ! value = ((SFComponentDescription) value).sfAsComponentDescription(); ((ComponentDescription) value).setParent(res); newContext.put(key, value); } else newContext.put(key, copyValue(value)); --- 604,614 ---- Object value = context.get(key); ! if (value instanceof Phases) { ! value = ((Phases) value).sfAsComponentDescription(); ((ComponentDescription) value).setParent(res); newContext.put(key, value); + } else if (value instanceof ReferencePhases) { + value = ((ReferencePhases) value).sfAsReference(); + newContext.put(key, value); } else newContext.put(key, copyValue(value)); *************** *** 687,691 **** } else if (name.equals(PhaseNames.SFCONFIG)) { ! actOn = (SFComponentDescription) sfResolve(sfConfigRef); } else if (name.equals(PhaseNames.LINK)) { --- 695,704 ---- } else if (name.equals(PhaseNames.SFCONFIG)) { ! Object sfc = sfResolve(sfConfigRef); ! if (sfc instanceof SFComponentDescription) { ! actOn = (SFComponentDescription)sfc ; ! } else { ! throw new SmartFrogCompileResolutionException(MessageUtil.formatMessage(ROOT_MUST_BE_COMPONENT, sfc.getClass().toString())); ! } } else if (name.equals(PhaseNames.LINK)) { *************** *** 726,732 **** phases.add(PhaseNames.TYPE); phases.add(PhaseNames.PLACE); phases.add(PhaseNames.SFCONFIG); phases.add(PhaseNames.LINK); - phases.add(PhaseNames.FUNCTION); phases.add(PhaseNames.PREDICATE); } else { --- 739,745 ---- phases.add(PhaseNames.TYPE); phases.add(PhaseNames.PLACE); + phases.add(PhaseNames.FUNCTION); phases.add(PhaseNames.SFCONFIG); phases.add(PhaseNames.LINK); phases.add(PhaseNames.PREDICATE); } else { |