1. Daniel Lowe
  2. OPSIN

Commits

Daniel Lowe  committed 621b186

Disallowed a name which consists of "mono" followed by a group name

  • Participants
  • Parent commits 14fb128
  • Branches default

Comments (0)

Files changed (1)

File opsin-core/src/main/java/uk/ac/cam/ch/wwmm/opsin/ComponentProcessor.java

View file
 						throw new ComponentGenerationException("Unable to assign all locants");
 					}
 				}
+				if (multiplier.getValue().equals("non")){
+					throw new StructureBuildingException("\"non\" probably means \"not\". If a multiplier of value 9 was intended \"nona\" should be used");
+				}
+				if (wordCount ==1){
+					throw new StructureBuildingException("Unexpected multiplier found at start of word. Perhaps the name is trivial e.g. triphosgene");
+				}
 				if (multiVal ==1){//mono
 					return;
 				}
-				if (multiplier.getValue().equals("non")){
-					throw new StructureBuildingException("\"non\" probably means \"not\". If a multiplier of value 9 was intended \"nona\" should be used");
-				}
 				List<Element> elementsNotToBeMultiplied = new ArrayList<Element>();//anything before the multiplier
 				for (int i = subOrBracket.indexOf(multiplier) -1 ; i >=0 ; i--) {
 					Element el = (Element) subOrBracket.getChild(i);
 					elementsNotToBeMultiplied.add(el);
 				}
 				multiplier.detach();
-				if (wordCount ==1){
-					throw new StructureBuildingException("Unexpected multiplier found at start of word. Perhaps the name is trivial e.g. triphosgene");
-				}
 				for(int i=multiVal -1; i>=1; i--) {
 					Element clone = state.fragManager.cloneElement(state, word);
 					if (assignLocants){