1 33 34 package edu.rice.cs.drjava.model.definitions.reducedmodel; 35 36 40 public class InsideDoubleQuote extends ReducedModelState { 41 public static final InsideDoubleQuote ONLY = new InsideDoubleQuote(); 42 43 private InsideDoubleQuote() { 44 } 45 46 58 ReducedModelState update(TokenList.Iterator copyCursor) { 59 if (copyCursor.atEnd()) { 60 return STUTTER; 61 } 62 copyCursor._splitCurrentIfCommentBlock(true,false); 63 _combineCurrentAndNextIfFind("","", copyCursor); 64 _combineCurrentAndNextIfEscape(copyCursor); 65 String type = copyCursor.current().getType(); 66 67 if (type.equals("\n")) { 68 copyCursor.current().setState(FREE); 69 copyCursor.next(); 70 return FREE; 71 } 72 else if (type.equals("\"")) { 73 if (copyCursor.current().isOpen()) 75 copyCursor.current().flip(); 76 77 copyCursor.current().setState(FREE); 78 copyCursor.next(); 79 return FREE; 80 } 81 else { 82 copyCursor.current().setState(INSIDE_DOUBLE_QUOTE); 83 copyCursor.next(); 84 return INSIDE_DOUBLE_QUOTE; 85 } 86 } 87 } 88 | Popular Tags |