1 33 34 package edu.rice.cs.drjava.model.definitions.reducedmodel; 35 36 40 public class InsideSingleQuote extends ReducedModelState { 41 44 public static final InsideSingleQuote ONLY = new InsideSingleQuote(); 45 46 49 private InsideSingleQuote() { 50 } 51 52 63 ReducedModelState update(TokenList.Iterator copyCursor) { 64 if (copyCursor.atEnd()) { 65 return STUTTER; 66 } 67 copyCursor._splitCurrentIfCommentBlock(true, false); 68 _combineCurrentAndNextIfFind("", "", copyCursor); 69 _combineCurrentAndNextIfEscape(copyCursor); 70 71 String type = copyCursor.current().getType(); 72 73 if (type.equals("\n")) { 74 copyCursor.current().setState(FREE); 75 copyCursor.next(); 76 return FREE; 77 } 78 else if (type.equals("\'")) { 79 if (copyCursor.current().isOpen()) { 81 copyCursor.current().flip(); 82 } 83 84 copyCursor.current().setState(FREE); 85 copyCursor.next(); 86 return FREE; 87 } 88 else { 89 copyCursor.current().setState(INSIDE_SINGLE_QUOTE); 90 copyCursor.next(); 91 return INSIDE_SINGLE_QUOTE; 92 } 93 } 94 } 95 | Popular Tags |