Changeset 108
- Timestamp:
- 07/10/05 23:31:17 (3 years ago)
- Files:
-
- trunk/dsp/DSPGrammar.d (modified) (2 diffs)
- trunk/dsp/DSPProcessor.d (modified) (2 diffs)
- trunk/dsp/Register.d (modified) (1 diff)
- trunk/dsp/ServletGenerator.d (modified) (1 diff)
- trunk/dsp/servlet/DSPLibraryCache.d (modified) (5 diffs)
- trunk/dsp/tags/Code.d (modified) (1 diff)
- trunk/dsp/tags/InCode.d (modified) (1 diff)
- trunk/dsp/tags/OutCode.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/dsp/DSPGrammar.d
r104 r108 42 42 public static char[] servletDecl = "(IDSPRequest request, IDSPResponse response)"; 43 43 44 public static char[] outputFunc = "response.getWriter .put";44 public static char[] outputFunc = "response.getWriter << "; //"response.getWriter.put"; 45 45 public static char[] replaceFunc = "std.string.replace"; 46 46 public static char[] toStringFunc = "std.string.toString"; … … 70 70 71 71 public static char[] beginOutput(){ 72 return outputFunc ~ " (``";72 return outputFunc ~ "``"; //"(``"; 73 73 } 74 74 75 75 public static char[] endOutput(){ 76 return " );" ~ newline;76 return ";" ~ newline; //");" ~ newline; 77 77 } 78 78 trunk/dsp/DSPProcessor.d
r104 r108 61 61 case "in": 62 62 generator.appendCPIn(data); 63 generator.appendCPIn(";"); 63 64 break; 64 65 65 66 case "out": 66 67 generator.appendCPOut(data); 68 generator.appendCPOut(";"); 67 69 break; 68 70 … … 82 84 else if(name == DSPGrammar.rawPreamble){ 83 85 generator.appendBody(data); 86 generator.appendBody(";"); 84 87 } 85 88 else{ trunk/dsp/Register.d
r102 r108 94 94 char[] value; 95 95 char[] name; 96 96 97 97 void appendCode(char[] code){ 98 98 if(type == RegisterType.TEXT){ trunk/dsp/ServletGenerator.d
r107 r108 63 63 Box[] stack; 64 64 65 int contentMode;66 bit outputSegment;65 public int contentMode; 66 public bit outputSegment; 67 67 68 68 enum{ trunk/dsp/servlet/DSPLibraryCache.d
r107 r108 163 163 } 164 164 165 protected void dropEntry(DSPLibrary lib){ 166 debug printf("dropEntry\n"); 165 // removes an entry from the list 166 protected void removeEntry(DSPLibrary lib){ 167 debug printf("removeEntry\n"); 167 168 if(lib.next) lib.next.last = lib.last; 168 169 if(lib.last) lib.last.next = lib.next; … … 181 182 } 182 183 184 // inserts library at the head of the list 183 185 protected void makePopular(DSPLibrary lib){ 184 186 debug printf("makePopular\n"); 185 dropEntry(lib);187 removeEntry(lib); 186 188 if(mostPopular is null){ 187 189 mostPopular = lib; … … 195 197 } 196 198 197 protected void dropLeastPopular(){ 198 debug printf("dropLeastPopular\n"); 199 // attempt to remove the least popular, unused library 200 protected void removeLeastPopular(){ 201 debug printf("removeLeastPopular\n"); 202 199 203 if(leastPopular){ 200 leastPopular.unload();201 leastPopular = leastPopular.next;202 if(leastPopular){203 leastPopular.last = null;204 // are we being used right now? 205 if(!leastPopular.inUse){ 206 leastPopular.unload(); 207 removeEntry(leastPopular); 204 208 } 205 209 } … … 214 218 215 219 if(freeCount == 0){ 216 //replace oldest cache entry and free the replaced entry 217 map.remove(leastPopular.key); 220 //replace oldest cache entry (if possible) and free the replaced entry 218 221 synchronized(this){ 219 dropLeastPopular();222 removeLeastPopular(); 220 223 makePopular(lib); 221 224 } … … 237 240 //remove this entry from the list 238 241 synchronized(this){ 239 dropEntry(lib);242 removeEntry(lib); 240 243 } 241 244 freeCount++; trunk/dsp/tags/Code.d
r97 r108 41 41 42 42 public void endTag(ServletCompilationContext context,char[] name,XMLAttributes attribs,bit isEmpty){ 43 context.generator.setContentMode(ServletGenerator.LiteralContentMode); 43 with(context){ 44 generator.appendBody(";"); 45 generator.setContentMode(ServletGenerator.LiteralContentMode); 46 } 44 47 } 45 48 } trunk/dsp/tags/InCode.d
r97 r108 40 40 41 41 public void endTag(ServletCompilationContext context,char[] name,XMLAttributes attribs,bit isEmpty){ 42 context.generator.setContentMode(ServletGenerator.LiteralContentMode); 42 with(context){ 43 generator.appendCPIn(";"); 44 generator.setContentMode(ServletGenerator.LiteralContentMode); 45 } 43 46 } 44 47 } trunk/dsp/tags/OutCode.d
r97 r108 36 36 class OutCode : DSPTag{ 37 37 public void startTag(ServletCompilationContext context,char[] name,XMLAttributes attribs,bit isEmpty){ 38 context.generator.setContentMode(ServletGenerator. InCodeContentMode);38 context.generator.setContentMode(ServletGenerator.OutCodeContentMode); 39 39 } 40 40 41 41 public void endTag(ServletCompilationContext context,char[] name,XMLAttributes attribs,bit isEmpty){ 42 context.generator.setContentMode(ServletGenerator.LiteralContentMode); 42 with(context){ 43 generator.appendCPOut(";"); 44 generator.setContentMode(ServletGenerator.LiteralContentMode); 45 } 43 46 } 44 47 }
